Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to open and print microsoft word from Access Form 1

Status
Not open for further replies.

sarge97

Technical User
Dec 15, 2003
16
US
I have many Form letters in Microsoft that were created using mail merge and the mail merge info is from a db that I created. I can't figure out how to print the mail merge document from my access form without having to open microsoft word each time. I only get as far as creating the command button and then I'm lost.

Thanks for any help
 
Hallo,

As I understand it:
Printing a Word Document has to be done by Word.
What you can do is get your command button to open Word,
open the document, print it, close the document and close Word. This can all be hidden from the user (apart from the bit where the machine grinds to a halt while it's doing all that.
The code will look something like:
Code:
  Dim objWord As Object
  Set objWord = CreateObject("Word.Application")
  objWord.FileOpen "C:\My Documents\MyDocument.doc"
  objWord.FilePrint
  objWord.FileClose nosave
  objWord.Quit
  set objWord = Nothing
I'm pretty sure the above is wrong, but I can't remember the commands. They're word vba names, I think.

- Frink


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top