Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Print Word Docs (Tamar? Della?)
Message
De
13/03/2002 09:37:00
 
 
À
13/03/2002 07:06:45
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00631971
Message ID:
00632068
Vues:
13
>here is what I do but that keeps asking:
>
>	SCAN
>		lcFormName = ALLTRIM(cc1.fname)	
>		IF NOT EMPTY(lcFormName ) AND FILE(lcFormName )
>		oWord=CREATEOBJECT("Word.Application")
>		oWord.VISIBLE=.F.
>		oWord.DisplayAlerts=.F.  && Dont' ask , but it does anyway!!!
>		oWord.DOcuments.Open(lcFormName )
>		oWord.ActiveDocument.PrintOut(.t.)
>		oWOrd.Quit()
>		oword=""
>		ENDIF
>	
>	ENDSCAN
>
>

Here's how I'd rewrite that code:

oWord = CreateObject("Word.Application")
oWord.DisplayAlerts = .F.

SCAN
lcFormName = ALLTRIM(cc1.fname)
IF NOT EMPTY(lcFormName) AND FILE(lcFormName)
oDoc = oWord.Documents.Open(lcFormName)
oDoc.PrintOut(.t.)
oDoc.Close(0) && Close without saving
ENDIF
ENDSCAN

oWord.Quit()

Hope this helps.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform