General information
Category:
COM/DCOM and OLE Automation
>Hi,
>
>I am printing a Word Document from VFP 7 using these simple commands
>loWord=CreateObject("Word.Application")
>If Vartype(loWord)="O"
> loDoc=loWord.Documents.Open(tcWordDocFile)
> loDoc.PrintOut(.T.)
> loDoc.Close()
> loWord.Quit && << problem command here >>>
>Endif
>
>The problem is when I issue the quit command, Word will come up saying 'Quitting Word will cancel all your pending print jobs. Do you want to quit now?' I tried to give a timeout before the quit, but as the time would vary depending on the size of the document, it is not reliable.
Pass .F. rather than .T. to the PrintOut method so that you're not printing in the background.
Tamar
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only