openoffice template startup get directory macro

☆樱花仙子☆ 提交于 2019-12-25 04:18:12

问题


I like to start a openoffice template (.ott) via my command prompt. Once my template.ott has opened it is called Untitled 1.odt

What I need is way to get the location of the template.ott (the path to the directory of the template that made Untitled 1.odt). I want to use that path in a macro in Untitled 1.odt

The question summarized: So when I have a macro in Untitled 1.odt, how do I get the location of the template.ott?

I use OpenOffice Writer.

EDIT: I write macros in Openoffice Basic.


回答1:


From Listing 5.47 of Andrew Pitonyak's macro document:

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


来源:https://stackoverflow.com/questions/36444239/openoffice-template-startup-get-directory-macro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!