Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

calling a word macro from java

 
Patrick B�rub�
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Patrick B�rub�
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic