Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print Word Docs (Tamar? Della?)
Message
From
13/03/2002 09:37:00
 
 
To
13/03/2002 07:06:45
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00631971
Message ID:
00632068
Views:
12
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform