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!

Prevent Word Exiting until Printing Done 2

Status
Not open for further replies.

delboy1295

Technical User
Nov 27, 2003
7
0
0
GB
You techies have been very helpful to me previously - I'd like to try again!

I'm calling Word from a bespoke VBA application.
I assign bookmarks & print a couple of copies of a document.

When I add the line:-

WordApp.Quit

I get the message that exiting Word will stop the spooling/printing. This causes wobbles in the App.

Is there a way of only quitting when printing is complete?

Thanks in Anticipation!
 
You need this before PrintOut
Options.PrintBackground = false

This lets you Quit after output is spooled. Make sure you use
Quit False ' Avoid "Save" prompt

I used the "named parameter" version

Public Sub PrintDocument(Optional strCopies = "3")

'*****
'* Print Document
'*****
Application.PrintOut FileName:="", _
Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, _
Copies:=strCopies, _
Pages:="", _
PageType:=wdPrintAllPages, _
Collate:=True, _
Background:=False, _
PrintToFile:=False

End Sub


Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top