Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word 97 document
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00145212
Message ID:
00145321
Views:
38
>John,
>
>I'm sure there are tons of different ways of doing things in Word97 as there are in VFP, but this works well for me to save the doc if it's an existing file:
>
>this.moWord.Activate() && so Save dialog appears
>this.moContractDocument.Close( wdPromptToSaveChanges, wdWordDocument, .t. )
>
>And if it's a new file:
>with this.moContractDocument
> .SaveAs( this.mcContractDocumentName, , , , .t. )
> .Close()
>endwith
>
>And to Print all I do is this:
>
>this.moWorkOrderDocument.PrintOut()
>
>
>>**** Currently you have to use wordbasic to do the printing.
>>**** vba's print method isn't supported in versions prior to VFP 6.
>>**** However, vba print preview is . . .
>>*Oword.activedocument.PrintPreview
>>oWord.WordBasic.FilePrint(.t.,,,,,,,1)
>
>>**** Currently you have to use wordbasic to save the file.
>>**** vba's saveas and save methods aren't supported.
>>*** save the file as whatever
>>*!* For this demo I'm saving the file dynamically by using the
>>*!* system time as the file name and storing it in the root directory
>>*!* of the c: drive. Make your adjustments to suit your needs.
>
>>oword.wordbasic.filesaveas(lcfile)

Yeah, this code was version 5.0 and the vba code wouldn't work. I use the later stuff in my version 6 code too.
John Harvey
Shelbynet.com

"I'm addicted to placebos. I could quit, but it wouldn't matter." Stephen Wright
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform