Excecute a word doc. & the macro with in it.

J

JattilaB

How can I have a xl macro run a word document? and when the word doc. is closed have it refresh it self
 
A

Adiv

From Excel:

Set a reference to the Word object library

Dim wdApp as Word.Application
Dim wdDoc as Word.Document

Set wdApp = New Word.Application
Set wd.Doc = wdApp.Documents.Open("C:\My Path\Mydoc.doc")
'additional code goes here
wdDoc.Save
wdApp.Quit True ' save any changes to the Word document
Set wdDoc = Nothing
Set wdApp = Nothing
 
Top