Sub Main
sFileURL = "file:///C:/Users/Desktop/paragraph.odt"
oTypeDetection = CreateUnoService("com.sun.star.document.TypeDetection")
msgbox oTypeDetection.queryTypeByURL(sFileURL)
End Sub
戻り値は string 型で OOo でファイルを読み込む際のフィルター名。
このフィルター名はファイルを開くときに利用できます。
フィルター名の一覧取得
Sub Main
sFileURL = "file:///C:/Users/Desktop/paragraph.odt"
oTypeDetection = CreateUnoService("com.sun.star.document.TypeDetection")
sElements = oTypeDetection.getElementNames()
sTxt = ""
For i = 0 To UBound(sElements)
sTxt = sTxt & sElements(i) & chr(10)
Next i
msgbox sTxt
End Sub