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