Probleme beim pdf-erstellen
10.09.2008 11:03:00
pdf-problem
ich versuche derzeit aus Excel startend ein PDF aus einem Word-File zu generieren. Den Code habe ich weitgehend von einer englischsprachigen Seite übernommen, leider erhalte ich eine Fehlermeldung (Run-time error '429' ActiveX component can't create object).
Distiller sollte korrekt installiert und der entsprechende Verweis gesetzt sein. Weiss jemand woran das liegt?
Public Sub print_to_pdf()
Dim wrd As New Word.Application
Dim doc As Word.Document
wrd.Visible = True
wrd.ScreenUpdating = True
wrd.ActivePrinter = "Acrobat Distiller"
'Open the document
Set doc = wrd.Documents.Open("h:\worddoc.doc")
'Print it to a PostScript file using Distiller
doc.PrintOut False, False, , "h:\test.ps", , , , , , , True
doc.Close False
wrd.Quit False
Set doc = Nothing
Set wrd = Nothing
'Now call distiller to convert the postscript file to PDF
Dim acr As New ACRODISTXLib.PdfDistiller6
acr.bShowWindow = False
acr.FileToPDF "h:\test.ps", "pdfdoc.pdf", ""
Set acr = Nothing
'Delete the old PS file
Kill "c:\test.ps"
'Done
End Sub
Besten Dank + Gruss