Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting MSWord .DOC to .PDF from VFP
Message
De
14/02/2007 11:31:06
Randy Witt
Diamond Vogel Paints
Orange City, Iowa, États-Unis
 
 
À
13/02/2007 18:11:55
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01194893
Message ID:
01195600
Vues:
20
Thanks, Perry. It turns out that I needed both your suggestion & John Harvey's. John's suggestion provided a much cleaner means of printing the document, but on some PC's it didn't activate the distiller to generate a .pdf from the .ps file. Your suggestion completed the picture, activating the distiller to generate the .pdf file. For some reason, possibly due to different versions of the installed distiller, I needed to change the "PDFDistiller.PDFDistiller" to remove the trailing ".1" to make the code work on some PC's. (This is the "VersionIndependentProgID" in the registry; at least, it works now for the Adobe versions we have.) This is the final,(excerpted) working code. Thanks much to both of you!

IF NOT(.oWord.Visible)
.oWord.Visible = .T.
ENDIF
.oWord.PrintOut(.F., ,, cNetPDFName+".PS", ,,,,,, .T.)

oDistiller = CREATEOBJECT("PDFDistiller.PDFDistiller")
oDistiller.FileToPDF(cNetPDFName + ".PS", cNetPDFName + ".PDF", "")
oDistiller = .NULL.

IF FILE(cNetPDFName + ".PS")
DELETE FILE (cNetPDFName + ".PS")
ENDIF
IF FILE(cNetPDFName + ".LOG")
DELETE FILE (cNetPDFName + ".LOG")
ENDIF
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform