Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Print Word Docs (Tamar? Della?)
Message
De
13/03/2002 16:17:10
 
 
À
13/03/2002 09:37:00
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00631971
Message ID:
00632400
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

Thanks Tamar (I was missing the close ( I had already moved the create and quit out of the loop.

Peter
Peter Cortiel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform