Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

Execute vbs file in Java Problem

Thread view: 
simon_s_li@hotmail.com - 23 Jul 2006 00:02 GMT
Hi,

I have a vbs (Visual Basic Script) file which needs to be executed from
Java.

The vbs file basically needs to read in a list of Word documents, where
each document gets parsed and the individual data isconverted into
HTML.

The problem is that when Java runs the vbs file to start the the
looping of each Word document it creates the usual $ file.  So if you
have a Word document called 'test.doc' and when you open it it created
a file called '$test'.

To run the vbs using the following command 'cscript test.doc'.

The problem is that it does not seem to finish looping through all the
Word documents.  So If I have 100 Word documents, it will only convert
3 Word documents to HTML.

I believe its these $ files, which are stopping it.

Is there any other way to call the vbs file from Java without creating
these $ files when it reads these Word documents??  Remember I've
already tried the cscript.

Any help is appreciated.

Regards
Simon
gimme_this_gimme_that@yahoo.com - 23 Jul 2006 01:26 GMT
Simon wrote:

> I have a vbs (Visual Basic Script) file which needs to be executed from
> Java.

I'd recommend using ANT to control the workflow, not Java.

> The vbs file basically needs to read in a list of Word documents, where
> each document gets parsed and the individual data isconverted into
[quoted text clipped - 4 lines]
> have a Word document called 'test.doc' and when you open it it created
> a file called '$test'.

Check the Javadocs, or the source if it is available and check if there
is a way to designate the file name.

> To run the vbs using the following command 'cscript test.doc'.

Like I said. I'd recommend calling the VBS from ANT. Also, note that
ANT is
easily customizable and you could create a an ANT task that would call
or
execute your Java code.

> The problem is that it does not seem to finish looping through all the
> Word documents.  So If I have 100 Word documents, it will only convert
[quoted text clipped - 5 lines]
> these $ files when it reads these Word documents??  Remember I've
> already tried the cscript.

I don't know why you think the problems have anything to do with $
files.
Why do you think that's the case?

I'd fathom that the problem is that the code you are using to parse the
Word document
is not compatible with a newer version of Word. In that case, the
solution is
to get an up-to-date Word parser.

You could look into writing a VBA pluggin with a sub that saves a Word
document
as XML. Then you could have Java parse the document as an XML file.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.