Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing an MS Word Document from within VFP
Message
 
À
17/11/2000 00:22:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00443039
Message ID:
00443042
Vues:
17
>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,
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform