Consultor Eletrônico



Kbase P69037: ACTIVEX - How to print a Word document
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   4/7/2005
Status: Verified

GOAL:

How to print a Word document using ActiveX Automation

GOAL:

How to print from Word without display any warning messages

FIX:

DEFINE VARIABLE chWord as COM-HANDLE NO-UNDO.
DEFINE VARIABLE chDoc AS COM-HANDLE NO-UNDO.

CREATE "word.application" chWord.

/* Hide Microsoft Word */
chWord:visible = false.

/* Open the document */
chDoc = chWord:documents:open("c:\Document1.doc").

/* Print the document without displaying any warning messages */
chDoc:printout(0). /* 0 : wdDoNotSaveChanges */

/* Quit Word */
chword:quit().

RELEASE OBJECT chDoc.
RELEASE OBJECT chWord.