Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PrintOut(0) forces a save
Message
From
07/07/2001 11:46:48
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00527723
Message ID:
00527768
Views:
19
>>In Word automation, I do a bunch of changes and save the document. Everthing is ok. The VFP starts Word, opens a document, applies changes to it, saves the document and closes Word. However, if I add a PrintOut(0) just before closing Word, this will force a save and a prompt will appear to ask me if I want to save my changes or not. How can I avoid that?
>
>I think you have wrong first parameter. It should be logical:
>llPrintBackGround = .f.            && parm 1
>lnPrintRangeType  = wdPrintFromTo  && parm 3
>lcOutPutFileName  = ""             && parm 4
>lcFrom            = "1"            && parm 5
>lcTo              = "1"            && parm 6
>lnCopies          = "1"            && parm 8
>lcPageRange       = ""             && parm 9  if parm 3 is wdPrintRangeOfPages
>llPrintToFile     = .f.            && parm 11 only if lcOutPugFileName is used
>
>oWord.oDocument.PrintOut(llPrintBackGround, , lnPrintRangeType, , lcFrom, lcTo, , lnCopies)
>
Passing 0 or .F. is the same thing. However, I used your approach to pass a logical.

Here is my code:
loWord=CREATE('Word.Application')
loWord.Documents.Open('d:\myfile.doc')
loWord.ActiveDocument.PrintOut(.F.)
loWord.Quit
That prints the document. I see the printer status in VFP. After, I have the message from Word if I want to save my document. If I don't print, I don't have this message.

Might there be a setting in Word which forces the document to be saved if I print it?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform