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!

MS Word: ActiveDocument.PrintOut

Status
Not open for further replies.

redheadpgr

Programmer
Feb 8, 2002
17
0
0
US
I have a macro which retrieves data from a database after a user enters an order number in an inputbox. After the macro retrieves the data, it puts the info in some bookmarked places in the active document in MS Word. Afterward, the macro calls the command to print the document:

ActiveDocument.PrintOut Range:=wdPrintAllDocument

After this command, the program loops to prompt the user to enter another order number. If they select cancel, the macro will end execution.

The problem is this: the printer does not start printing until the macro has ended execution. Therefore, there may be several jobs in the print spooler. I need this to print the document as soon as it runs the PrintOut command.

I have set breakpoints in the macro right after the PrintOut command and in break mode it will print the document. Is there something in the VB environment that hangs the print queue?

Any help would be most appreciated. Thanks.
 
> ActiveDocument.PrintOut Range:=wdPrintAllDocument
Have you tried to play with the Background name parameter ?

Hope This Help
PH.
 
Great idea! It worked. I entered:

ActiveDocument.PrintOut Range:=wdPrintAllDocument, Background:=False

I appreciate the help so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top