Running a Word macro from Access

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
 
A

Arvin Meyer

Miguel Velez said:
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?

You don't. Shelling Word opens it in another process. You want to use
automation to talk to Word. There's a sample of some Word automation code at
my website:

http://www.datastrat.com/Code/WordMerge.txt

and several more using Excel (same principle) at the Access Web ... here's
one:

http://www.mvps.org/access/modules/mdl0007.htm
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

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

Top