EPamperin12
New Member
- Joined
- Jan 8, 2008
- Messages
- 47
I'm using Word 2002 SP3 and Adobe Acrobat Professional 7.
I am trying to automate a save process that will create a PDF File.
The code below will create the Distiller File, however it will not run the distiller to complete the conversion to PDF.
I can manually go into the Distiller and click on the file and it creates the Pdf w/ the correct file name
I have already added the Acrobat Distiller, Create Adobe PDFMAker for Office and Adobe PDFMakerX to the Refereneces in VBA
I am getting a RunTime Error '-2147417851 (80010105)' Method 'FileToPDF' of object 'IPdfDistiller' failed.
Any help would be most appreciated.
-Eric
I am trying to automate a save process that will create a PDF File.
The code below will create the Distiller File, however it will not run the distiller to complete the conversion to PDF.
I can manually go into the Distiller and click on the file and it creates the Pdf w/ the correct file name
I have already added the Acrobat Distiller, Create Adobe PDFMAker for Office and Adobe PDFMakerX to the Refereneces in VBA
Code:
Sub Create_PDF()
Dim tempPDFFileName As String
Dim tempPSFileName As String
Dim tempPDFRawFileName As String
Dim tempLogFileName As String
tempPDFRawFileName = ("H:\CreatePDF")
tempPSFileName = tempPDFRawFileName & ".ps"
tempPDFFileName = tempPDFRawFileName & ".pdf"
tempLogFileName = tempPDFRawFileName & ".log"
ActiveDocument.PrintOut OutputFileName:=tempPSFileName
Dim mypdfDist As New PdfDistiller
mypdfDist.FileToPDF tempPSFileName, tempPDFFileName, ""
Kill tempPSFileName
kill templogFileName
End Sub
I am getting a RunTime Error '-2147417851 (80010105)' Method 'FileToPDF' of object 'IPdfDistiller' failed.
Any help would be most appreciated.
-Eric