>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