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

printing a word document 1

Status
Not open for further replies.

sicohne

Technical User
Jun 30, 2003
51
GB
My program opens a word document, prints it out then closes it. The trouble is that if the document hasn't finished printing by the time the program quits word, it finishes printing the page it's on and stops.

Is there a way to check whether word has finished printing before closing it?
 
I beleive there is a pause argument on the print command. That may be what you need.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
It is the first time i hear this issue.
I had similar application. The three last lines were:

1-print_the_document
2-appword.Quit
3-appword = Nothing

Had exited and destroyed the variable 'appword', the document was in memory; (in tray icon i could see that 3 of six pages were printed) ...
 
Yup, here it is:
Code:
Word.ApplicationClass.PrintOut(False)

The false is for Background. Setting BG to false will make it print in the foreground (ie: this thread) so that the next command shouldn't fire until the printing is complete.

-Rick

----------------------
[banghead]If you're about to post an ASP.Net question,
please don't do it in the VB.Net forum[banghead]

[monkey] I believe in killer coding ninja monkeys.[monkey]
 
word.application.printout(false) worked a treat, thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top