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 do I attach a macro to an OO.o Base file....

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


Joined: 14 Dec 2005
Posts: 13

PostPosted: Thu Jan 05, 2006 8:27 am    Post subject: How do I attach a macro to an OO.o Base file.... Reply with quote

How do I attach a macro to an OO.o Base file in such a way that I will be able to launch the .odb from another computer on the network and all of my macros will still work?
Back to top
View user's profile Send private message
noranthon
Super User
Super User


Joined: 07 Jul 2005
Posts: 3318

PostPosted: Thu Jan 05, 2006 11:41 pm    Post subject: Reply with quote

This is probably sacrilege but it seems to me that the only way you can do this (short of editing the soffice macros) is to add a module to one of the soffice libraries. At least one library ("Gimmicks") on my computer lets you do that. The soffice libraries are prefixed "[Open Office.org Macros and Dialogs]".

From a Base document, that means /Tools /Macros /Organize Macros /OpenOffice.org Basic , then select a macro in one of the libraries and press Edit. (Don't edit it.) Right-click on the tab for the last module in the window that opens (tabs at the bottom) and if the context menu gives you the command "Insert : Basic Module", you're in business. You can copy and paste your macro into the new module.

Actually running the macro would be a tedious process unless you can add a menu item to the menu on all computers on the network (hope that does not mean adding it one by one to the menu on each computer).

This outrageous suggestion may bring down the wrath of the righteous, so that will, hopefully bring some better ideas with it.
Back to top
View user's profile Send private message
mythril
General User
General User


Joined: 14 Dec 2005
Posts: 13

PostPosted: Tue Jan 10, 2006 8:32 am    Post subject: Thank you Reply with quote

This will work for the time being, but is incredibly tedious. If there is a better solution out there please speak up Wink
_________________
Windows XP (Most flavors)
Linux (Gentoo)
OpenOffice.org (2.0)
Back to top
View user's profile Send private message
DrewJensen
Super User
Super User


Joined: 06 Jul 2005
Posts: 2616
Location: Cumberland, MD

PostPosted: Tue Jan 10, 2006 8:41 am    Post subject: Reply with quote

Mythril,

You can attach macros to embedded forms in a database, or you can place macros into an outside library. Your choice. There is an issue with using the embedded forms, so I would pick the library path...

Then there is one other way...You can attach macros to ANY document other then an ODB file. Well, so why not just create a companion writer document for your database. All the macro's can be embedded in this document. If it is in the same path as the Base odb file then I believe you can just refer to the macros from your forms via relative addressing..

So - when you move you odb you have to take a odt along with it...

Oh, and about those menus..just attach them to the odt document...and they can reference the database...it becomes the NAVIGATOR form for your database.

Drew
_________________
Blog - http://baseanswers.spaces.live.com/
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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