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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Initiate Word Print from Access control? Or am I stuck with a macro? 1

Status
Not open for further replies.

TimSlape

Technical User
Jun 1, 2001
18
0
0
US
Dim oApp As Object

Set oApp = CreateObject("Word.Application")
oApp.Documents.Open FileName:="C:\Smart\AdStratAll.doc"
oApp.Visible = True

Works great for opening the merged doc, but what is the command code to print it? The client wants to be able to print the doc from a click in the Access app.

Also, would like to open the same doc in print preview mode in same manner.

Thanks!
 
Do you have to show it to them before you print it? Does it ever change? You can simply call a print command using the .Printout method of a word document. Don't know if this would work, but maybe worth investigation.

HTH Joe Miller
joe.miller@flotech.net
 
Joe,

Amazing what a good night's sleep and some help from an expert can accomplish! The .Printout method did the trick whether Visible was True or False. It just quietly merges and starts printing. Thanks a million!

Now, if I can figure out how to pull the merged doc up in PrintPreview from VBA, my day will be complete.

Tim Slape
 
You would have to write the print preview code in the document not in Access I believe. So that whenever that document is opened it goes into Print Preview mode. Word supports VBA just like Access. Joe Miller
joe.miller@flotech.net
 
Thanks again, Joe. I think I'll let the user select pront preview mode themselves, from within Word.

Tim Slape
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top