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

how to get the document name in a macro

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
freyc
Newbie
Newbie


Joined: 27 Sep 2006
Posts: 1

PostPosted: Wed Sep 27, 2006 2:09 pm    Post subject: how to get the document name in a macro Reply with quote

I am trying to write an Ooo macro for calc. I need to get the name of my document to set my args before to do a uno:move operation. I guess it is something close to ThisComponent.getCurrentController.getFrame.name but this is not right
How can I get the document name out of ThisComponent.getCurrentController.getFrame
Back to top
View user's profile Send private message
noranthon
Super User
Super User


Joined: 07 Jul 2005
Posts: 3318

PostPosted: Wed Sep 27, 2006 5:18 pm    Post subject: Reply with quote

I would use ThisComponent.getUrl. There is also ThisComponent.getLocation. I've never looked into the difference, if any; there may only be a difference on Windows because Unix systems use the forward slash in paths.
_________________
search forum by month
Back to top
View user's profile Send private message
uros
Super User
Super User


Joined: 22 May 2003
Posts: 601
Location: Slovenia

PostPosted: Thu Sep 28, 2006 5:01 am    Post subject: Reply with quote

Hi freyc!
Take a look here too:
http://www.oooforum.org/forum/viewtopic.phtml?t=37664&start=0&postdays=0&postorder=asc&highlight=tools+library
Uros
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Thu Sep 28, 2006 1:41 pm    Post subject: Reply with quote

This set of named references returns information about URL, path, current sheet-name without macros:
cFilename =CELL("FILENAME")
FilePath =RIGHT(FileURLPath;LEN(FileURLPath)-7)
FileURL =MID(cFilename;2;SEARCH("'#";cFilename)-2)
FileURLPath =MID(cFilename;2;SEARCH("/[^/]+'#";cFilename)-1)
ThisSheet =MID(cFilename;FIND("#$";cFilename)+2;256)
DocName =MID(cFilename;SEARCH("/[^/]+$";cFilename)+1;LEN(cFilename)-FIND("#$";cFilename)+1)
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
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 Calc 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