OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Script integration and template path

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
briant79
General User
General User


Joined: 19 Sep 2006
Posts: 8
Location: Basel, Switzerland

PostPosted: Thu Feb 08, 2007 12:21 am    Post subject: Script integration and template path Reply with quote

Hello,

I developed a macro embedded in a Calc template file (macro.ots) and now want to provide it with initialization values from a macro.ini text file that is situated in the same folder.
When I now open a new "untitled" document from my template, I loose the information about the template document path. The Desktop.currentComponent.URL property is empty, because the new file is not stored yet and CurDir() does not always contain the right folder path, because it can be changed during run-time by another document or application.
Is there a way to reveal the path of my untitled document's parent template?

Furthermore I found a beanshell script getIP, that returns my machine's IP. I could integrate it into my macro as a user script, but did not succeed to integrate it properly into my file.

My current code is:
Code:

Private Const PATH_TO_GETIP = _
"vnd.sun.star.script:ZURF_ERP.getIP.bsh?language=BeanShell&location=user"

oScript = oScriptProvider.createScriptProvider("").getScript(PATH_TO_GETIP)
strIP = oScript.invoke(Array(), Array(), Array())


I somehow need to change the script location into:
Code:

Private Const PATH_TO_GETIP = _
"vnd.sun.star.script:ZURF_ERP.getIP.bsh?language=BeanShell&location=document"


Thanks in advance for your ideas.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group