Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing with Word
Message
From
21/01/2000 16:41:52
 
 
To
21/01/2000 15:38:04
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00321120
Message ID:
00321145
Views:
15
>Hi!
>
>I am trying to send a document to the printer using the following code:
>
>
>oAutomation = CREATEOBJECT("Word.Basic")
>oAutomation.FileOpen(cFileName)
>oAutomation.FilePrint
>oAutomation.FileQuit
>RELEASE oAutomation
>
>
>This code works fine, except that when the application hits the oAutomation.FileQuit command, I get a dialog box that says that quitting Word while printing will cancel my print job. On the other hand, if I comment the FileQuit command, WinWord stays in memory (checked using NT's Task Manager).
>
>Is there a way to know when Word has finished or to tell him to quit when he's done?
>
>Thanks!
>
>VFP6, NTW4

you can make your call print call Synchronous by disabling background printing in Word. In Word 2000, this is done by:

oWord.Options.PrintBackGround = .F.

In earlier versions, the syntax is different, but I don't have access to them now. If you need it, I can send you some sample code later, or you can just search the VBA help for Background Printing.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform