Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing an MS Word Document from within VFP
Message
 
To
17/11/2000 00:22:32
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00443039
Message ID:
00443042
Views:
12
>Sorry if this isn't the right category - shows what I know <g>.
>
>I want to do what the title says: no mail merge, no changing content.
>
>I just want to print a word document (say a product spec sheet) from within VFP.
>
>Would appreciate help in finding the right tech ref to explain how. I dug a bit, but my shovel is tired...
>
>Thanks


Hi Dennis,

Below is some sample code for opening and then printing a Word document from VFP. I assume it would be wise to implement some error trapping to make sure Word exists, etc, but the basics of opening and printing the document are outlined below.

oWord=CREATE('Word.Application')
oWord.Documents.OPEN("C:\DOCFOLDER\DOCNAME.DOC")
oWord.ActiveDocument.PrintOut(0)
oWord.ActiveDocument.CLOSE(0)
oWord.QUIT(0)
RELEASE oWord

I would highly recommend Tamar Granor's book "Microsoft Office Automation with Visual FoxPro" published by Hentzenwerke Publishing.

HTH,
Previous
Reply
Map
View

Click here to load this message in the networking platform