Seite 1 von 1

Hilfe bei Comate

Verfasst: 18.09.2016 16:48
von appndown
Hi,

ich verstehe das mit Comate einfach nicht...

Ich möchte ein Word Doc öffnen und als PDF abspeichern...
Egal was ich versuche es klapp einfach nicht.

Ich hab mir mal das als Markro in Word aufgezeichnet, aber wie setzt man das in Comate um ?
Bitte, kann mir nicht jemand helfen ?

Das Markro:

ActiveDocument.ExportAsFixedFormat OutputFileName:= _
"C:\Users\appnd\Desktop\ComateTest.pdf", ExportFormat:=wdExportFormatPDF, _
OpenAfterExport:=True, OptimizeFor:=wdExportOptimizeForPrint, Range:= _
wdExportAllDocument, From:=1, To:=1, Item:=wdExportDocumentContent, _
IncludeDocProps:=True, KeepIRM:=True, CreateBookmarks:= _
wdExportCreateNoBookmarks, DocStructureTags:=True, BitmapMissingFonts:= _
True, UseISO19005_1:=False

Gruß
Sascha

Re: Hilfe bei Comate

Verfasst: 23.09.2016 11:30
von Kiffi

Code: Alles auswählen

XIncludeFile "\Dein\Pfad\Zu\COMatePLUS.pbi"

EnableExplicit

#wdExportFormatPDF = 17

Define MyWordDoc.s = "\Dein\Pfad\Zum\Einzulesenden\doc.doc"
Define MyWordPdf.s = "\Dein\Pfad\Zum\Exportierenden\pdf.pdf"

Define WordApplication.COMateObject

WordApplication = COMate_CreateObject("Word.Application")

If WordApplication
  WordApplication\Invoke("Documents\Open('" + MyWordDoc + "')")
  WordApplication\Invoke("ActiveDocument\ExportAsFixedFormat('" + MyWordPdf + "', " + Str(#wdExportFormatPDF) + ")")
  WordApplication\Invoke("Quit")
  WordApplication\Release()
Else
  MessageRequester("COMate", "Couldn't create WordApplication!")
EndIf
Grüße ... Peter