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

Print Word document from VB6 problem

Status
Not open for further replies.

LPent

Programmer
Oct 3, 2002
50
TR
Hi,

I'm trying to print a Word document from VB6. The problem is, when I close Word directly after issuing a print command, the printjob is "lost" (Nothing is printed). When I don't close word, the document is printed as intended.

I have:

appWord.ActiveDocument.PrintOut Background:=True, Copies:=2
appWord.Quit wdDoNotSaveChanges

 
it take little time to spool.maybe a PAUSE between commands.
 
Replace this:
appWord.ActiveDocument.PrintOut Background:=True, Copies:=2
By this:
appWord.ActiveDocument.PrintOut Background:=False, Copies:=2

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks, It didn't work either, but I got it to work this way:

Code:
appWord.ActiveDocument.Printout Background:=False, Copies:=2
DoEvents
appWord.ActiveDocument.Close saveChanges:=wdDoNotSaveChanges
appWord.Quit wdDoNotSaveChanges
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top