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

Moving modules from one library to another, reassign macros

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Henrik
OOo Enthusiast
OOo Enthusiast


Joined: 15 Jan 2004
Posts: 118

PostPosted: Fri Feb 27, 2004 10:36 am    Post subject: Moving modules from one library to another, reassign macros Reply with quote

Hi,

I have a calc document with several sheets and quite a few buttons/controls. I want to move my modules from one library to another. The problem is that I have assigned macros to all my controls and after moving the modules, the controls will all point to macros that don't exist.

At the moment a control will typically point to a macro like this:
document:StandardLibrary.ModuleA.SubA

After moving the modules to another library they should point to:
document:NewLibrary.ModuleA.SubA

Is there another way than manually reassigning all the controls?

Henrik
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Fri Feb 27, 2004 12:28 pm    Post subject: Reply with quote

Having played with macros just a bit myself, I can understand why you might want to do such a thing. Smile

All OOo documents are actually ZIP files of xml. Unzip the document into a folder. It will have at a minimum....

content.xml
META-INF / manifest.xml

There will probably be other XML files. Within the content.xml you will find your buttons. Alter the macro library they point it by editing the XML text file. Then re-Zip everything back up and rename the suffix from ".zip" back to an OOo document (such as ".sxd" for Drawing, and something else for Calc).


Here's another hint. Before saving your documents, first....
Tools --> Options --> Load / Save --> General
then uncheck the box that says "Size optimization for XML". (You'll be glad you did!)


A tool that might help give you insight as to the structure of your documents is my Document Explorer, which you can get at...
http://OOoMacros.org
a direct link is here...
http://ooomacros.org/dev.php#92225
http://sourceforge.net/project/showfiles.php?group_id=87718&package_id=92225

Simply download the program. Unpack. Double click on the Jar to run the program. (Written in Java -- does not require OOo at all. OOo does not need to be running, or even be installed.) It prompts you for an OOo document. Then after you pick one, it opens a window that allows you to explore the contens of the Zip file, and the XML nodes.
_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Henrik
OOo Enthusiast
OOo Enthusiast


Joined: 15 Jan 2004
Posts: 118

PostPosted: Fri Feb 27, 2004 3:22 pm    Post subject: Reply with quote

Thx a lot DannyB Smile
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