Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Run a Macro inWord

Status
Not open for further replies.

filipet

Programmer
Oct 20, 2003
7
PT
I want in VbScript do run a Macro that is saved in a document:
I have this program:

set oWord = CreateObject("Word.Application")
oWord.Visible = True
oWord.Documents.Open "Document1.doc"
oword.Run "Document1.doc!Macro1"

The last row didn't work

Somebody can help me
 
Try something like this:
Code:
oword.Run "'Document1.doc'!NewMacros.Macro1"
The syntax is:
oword.Run "'myDocument.doc'!myModule.mySub"


Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top