查看當前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


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章