Information générale
Catégorie:
COM/DCOM et OLE Automation
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement