Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing a Word Document
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00443225
Message ID:
00443334
Vues:
14
>I've spent my entire xBase life without ever having to interact with any of the other inhabitants of my computer. I now find a need to take a Word document and sent it to the printer.
>
>I'd appreciate any help which can get me started.
>
>Thanks to all
>
>.........Rich

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. (Please note that this samplec code never "shows" Word.)

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

As the others have recommended, I would also highly recommend Tamar Granor's book "Microsoft Office Automation with Visual FoxPro" published by Hentzenwerke Publishing.

HTH,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform