Datei -> Eportieren per Makro ausführen, scheitert, da kein Export möglich
Verfasst: Mo 29. Mai 2023, 20:00
Hallo,
ich habe eine odt geöffnet und führe dieses Makro aus
Die erste MsgBox zeigt mir wie erwartet den Pfad, die zweite, dass es sich um ein Textdokument handelt, Das Problem ist die dritte, die sagt, es wäre kein Export möglich, obwohl ich von Hand den Export nach PNG einwandfrei durchführen kann. Was mache ich falsch?
ich habe eine odt geöffnet und führe dieses Makro aus
Code: Alles auswählen
Sub Main
Dim oDoc As Object
oDoc = ThisComponent
MsgBox oDoc.GetUrl(), 0, "oDoc.GetUrl()"
Dim bIsTextDoc As Boolean
bIsTextDoc = (oDoc.SupportsService("com.sun.star.text.TextDocument")) 'Test if it is a text document
If bIsTextDoc Then
MsgBox "Das aktuelle Dokument ist ein Textdokument.", MB_OK + MB_ICONEXCLAMATION, "Textdokument"
End If
Dim bSupportsExport As Boolean
bSupportsExport = (oDoc.SupportsService("com.sun.star.document.ExportFilter")) 'Check if the document supports the export service
If Not bSupportsExport Then
MsgBox "Das aktuelle Dokument unterstützt keine Exportfunktion.", MB_OK + MB_ICONEXCLAMATION, "Kein Export möglich"
End If
End Sub