查看当前ooo文档类型的宏

来源:互联网 发布:it外包平台 编辑:程序博客网 时间:2024/06/06 01:22
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


原创粉丝点击