document formatChristian JunkerTom SchindlHow can I get the document format
Only relying on the operating system which it self relys ont the file suffix
is sometimes not enough
You could use deep type-detection
Sub detectDocType()
Dim mediaDescr(30) as new {@see com.sun.star.beans.PropertyValue}
docurl = thisComponent.getURL()
mediaDescr(0).Name = "URL"
mediaDescr(0).Value = docurl
typemgr = createUnoService("{@see com.sun.star.document.TypeDetection}")
'make deep type detection (not just based on filename extension)
msgbox typemgr.queryTypeByDescriptor(mediaDescr(), True)
End SubInitial version