AUTOMATICALLY printing MS WORD doc from ACCESS

G

Guest

Is there a way to automatically print a word doc using a macro? I tried the
RunApp macro but I don't know what to put on the command line.
 
S

Steve Schapel

Ruth,

You can use a RunApp macro to open the Word document. The Command Line
argument will be something like this...
"C:\Program Files\Microsoft Office\...\Winword.exe"
"D:\YourFolder\YourDoc.doc"

However, as far as I know you can't make this print via a macro. You
can use Office Automation code to print the Word document. I think
something like this...
Dim WordObj As Object
Set WordObj = CreateObject("Word.Application­")
WordObj.Documents.Open "C:\YourFolder\YourFile.doc"
WordObj.PrintOut Background:=False
WordObj.Quit False
Set WordObj = Nothing

You would need to set a Reference to the Word Object Library. More
information available at http://support.microsoft.com/?id=154569
 
G

Guest

Steve Schapel said:
Ruth,

You can use a RunApp macro to open the Word document. The Command Line
argument will be something like this...
"C:\Program Files\Microsoft Office\...\Winword.exe"
"D:\YourFolder\YourDoc.doc"

However, as far as I know you can't make this print via a macro. You
can use Office Automation code to print the Word document. I think
something like this...
Dim WordObj As Object
Set WordObj = CreateObject("Word.Application­")
WordObj.Documents.Open "C:\YourFolder\YourFile.doc"
WordObj.PrintOut Background:=False
WordObj.Quit False
Set WordObj = Nothing

You would need to set a Reference to the Word Object Library. More
information available at http://support.microsoft.com/?id=154569
 
G

Guest

Steve,

Are the commands to open MS Word and then to Open the specific document on
two separate command lines or all part of one line? I've tried it both ways
and can't seem to get it to work.

timsken
 

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