簡體   English   中英

在 LibreOffice 宏中獲取 Basic 中的文檔路徑

[英]Getting document path in Basic in LibreOffice macro

我知道這個問題已經得到回答,但給定的解決方案對我不起作用。 給出的解決方案是:

Dim oDoc As Object
Dim Path$
oDoc = ThisComponent
Path$ = oDoc.getURL()

實際上,這會為我返回一個空字符串 ("")。 有什么我錯過了嗎?

我在 Kubuntu 12.04 上使用 LibreOffice 4.3.1.2。

謝謝你的幫助!

如果你運行這個會發生什么?

If oDoc.HasLocation() Then
  Print "The Document URL is " & oDoc.getURL()
Else
  Print "The document has not yet been stored"
End If

如果我編譯宏,它可以完美運行,如果我調試未編譯的宏,它就不起作用。

當然,因為調試環境 Parent 與您的 Document Parent 不一樣。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM