Running a Word macro from Access

  • Thread starter Thread starter Miguel Velez
  • Start date Start date
M

Miguel Velez

I want Access to open a Word document and then run a macro
contained in the Word document. I can open the document
using the Shell command but how do I get the Word macro
initiated from the Access VBA code?

Miguel
 
Forget Shell as it gives you no control

Cerate a reference to the Word object library and try something like

Dim myWord As New Word.Application
myWord.Documents.Open ("c:\MyDocWithTheMacro.doc")
myWord.Visible = True
myWord.Run "MyMacroName"
 
Back
Top