Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Converting MSWord .DOC to .PDF from VFP
Message
From
14/02/2007 11:31:06
 
 
To
13/02/2007 18:11:55
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01194893
Message ID:
01195600
Views:
19
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
Previous
Reply
Map
View

Click here to load this message in the networking platform