File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes calling a word macro from java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "calling a word macro from java" Watch "calling a word macro from java" New topic
Author

calling a word macro from java

Patrick B�rub�
Greenhorn

Joined: Oct 20, 2003
Posts: 2
Hi,
I would like to call a word macro from VBA in Word 2000. I want to do that from a java script.
I know how to open an existing word document but I don't know how to call the macro after.
Please help!!!
Thanks alot,
Pat
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
See if the Jacob Package fom Dan Adler helps. It lets you use COM interfaces from Java. It's free but not showing a lot of current activity or support, so if you're betting your career on it, google for commercial Java-Com bridges.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Patrick B�rub�
Greenhorn

Joined: Oct 20, 2003
Posts: 2
I already used Jacob to open an existing Word Document but I really don't know how to use it to call a macro in Word.
Any suggestions ???
Hope someone knows !!!
Patrick B�rub� :roll: :roll: :roll:
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Now you have to dive into MS documentation. If you can find a VB example of calling a macro (from a stand-alone VB program, not a macro started in Word) you have to try to mimic that in Java with Jacob. For example, if VB uses a getDocument() method or documents collection, you can try getting the same object in Jacob. I did some of this with IE and spent hours in the MS scripting documentation guessing how to do the same thing in Jacob. Try the Jacob samples and discussion group. This sounds like a common enough task that somebody there will know how to do it. Best of luck!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calling a word macro from java