Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to know when word finished printing
Message
De
22/05/2003 02:59:33
 
 
À
21/05/2003 13:56:20
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00791108
Message ID:
00791471
Vues:
16
>>This is how I do it
>>
>>
>>declare Sleep in Win32api integer
>>do while !empty(WordObj.Application.BackgroundPrintingStatus)
>>	=Sleep(2000)
>>enddo
>>
>
>Thanks Gregory
>
>It seems like if property BackgroundPrintingStatus is not evaluated as a property at such level, I´m getting an unknown COM error.
>
>
>What could I be doing wrong?
>
>Regards
>
>Oscar

Oscar,

Difficult question. I honnestly do not know.

Just tested this. As a starter, does this work for you ?
DocumentPath = '\tmp\test.doc'
WordObj = CreateObject('Word.Application')
=WordObj.Documents.Open(DocumentPath)

#define wdDialogFilePrint                      88

with WordObj.ActiveDocument.Application.Dialogs(wdDialogFilePrint)
	*.Printer = PrinterName
	.numcopies = 1
	.Execute()
endwith
#undefine wdDialogFilePrint

&&WordObj.ActiveDocument.PrintOut(FALSE,,,,,,,)
do while !empty(WordObj.Application.BackgroundPrintingStatus)
	=sleep(2000)
enddo

#define wdDoNotSaveChanges         0

&&WordObj.ActiveDocument.Close(wdDoNotSaveChanges)
WordObj.Quit(wdDoNotSaveChanges)

#undefine wdDoNotSaveChanges
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform