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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top