openoffice模板启动获取目录宏

openoffice template startup get directory macro

我喜欢通过命令提示符启动 openoffice 模板 (.ott)。 打开我的 template.ott 后,它被称为无标题 1.odt

我需要的是获取 template.ott 位置的方法(制作无标题 1.odt 的模板目录的路径)。我想在 Untitled 1.odt

的宏中使用该路径

问题总结: 所以当我在 Untitled 1.odt 中有一个宏时,如何获取 template.ott 的位置?

我使用 OpenOffice Writer。

编辑: 我在 Openoffice Basic 中编写宏。

来自 Andrew Pitonyak's macro document 的清单 5.47:

Sub GetTemplatePath
    Dim oDocProps
    oDocProps = ThisComponent.getDocumentProperties()
    MsgBox "TemplateURL " & oDocProps.TemplateURL
End Sub