查看当前ooo文档类型的宏

Sub detectType()
    Dim mediaDescr(3) as new com.sun.star.beans.PropertyValue

    docurl = thisComponent.getURL()
    mediaDescr(0).Name = "URL"
    mediaDescr(0).Value = docurl

    typemgr = createUnoService("com.sun.star.document.TypeDetection")
    'make deep type detection (not just based on filename extension)
    msgbox typemgr.queryTypeByDescriptor(mediaDescr(), True)

End Sub


你可能感兴趣的:(url,文档,extension)