【问题标题】:Libreoffice macro to get information about document statisticsLibreoffice 宏获取有关文档统计信息的信息
【发布时间】:2019-01-28 13:33:34
【问题描述】:

问题在于脚本会立即解析文档中的所有计算数据(如果文档很大),而没有给它加载和计数的时间。可以做什么?

Sub GetStatistics(cFile)
    cUrl = ConvertToURL(cFile)
    oDoc = StarDesktop.loadComponentFromURL(cUrl, "_blank", 0, Array())
    Data = oDoc.GetDocumentProperties().DocumentStatistics
    s = ""
    For i = LBound(oData) To UBound(oData)
        s = s & oData(i).Name & " : " & oData(i).Value & CHR$(10)
    Next
    MsgBox(s)
End Sub

Large document

Simple document

【问题讨论】:

    标签: libreoffice libreoffice-basic


    【解决方案1】:

    根据您的要求,您可以添加例如

    Wait 2000
    

    之后

    oDoc = StarDesktop.loadComponentFromURL(cUrl, "_blank", 0, Array())
    

    确保完全加载。

    据我所知,没有办法完全触发loadComponentFromURL 已完成。

    【讨论】:

      猜你喜欢
      • 2011-08-20
      • 1970-01-01
      • 2011-05-21
      • 1970-01-01
      • 1970-01-01
      • 2012-06-18
      • 2012-01-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多