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

Export MyMacro to another OpenOffice Machine

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


Joined: 23 Nov 2005
Posts: 1

PostPosted: Wed Aug 29, 2007 5:19 pm    Post subject: Export MyMacro to another OpenOffice Machine Reply with quote

I have a standard install of Open Office 2

I have created a macro and it is saved to
My Macros - Standard - Module1 and called Stock

I would like to export this macro to another PC with open office on our network, but I have no idea how you do that

Thanks!
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 Aug 30, 2007 6:28 am    Post subject: Reply with quote

You should use meaningful names for your libraries and modules, since there might be another "Standard.Module1" already.
Write some documentation in a Writer file and copy the code into that file.
http://www.oooforum.org/forum/viewtopic.phtml?t=59756&highlight=organizer

Tools>Macro>Organize>Basic... button [Organizer...] lets you import this file's library into "My Macros" or copy the module(s) by Ctrl+drag&drop to any place.

Or create a simple add-on package of Basic code:
Create a new directory with sub-directory META-INF
META_INF gets one file "manifest.xml" with following 4 lines of content (MY_LIB_NAME is a placeholder):
Code:

<?xml version="1.0" encoding="UTF-8"?>
<manifest:manifest>
        <manifest:file-entry manifest:full-path="MY_LIB_NAME/" manifest:media-type="application/vnd.sun.star.basic-library"/</manifest:manifest>

Copy all contents of directory <OOo_user_dir>/user/basic/<LIB_IN_QUESTION> into a new sub-directory "MY_LIB_NAME".
Create a zip archive, including the two sub-directories.
The content of the zip should be:
META-INF/
+...manifest.xml
MY_LIB_NAME/
+...someModule.xba
+...someOtherModule.xba
+...script.xlb
+...dialog.xlb

Change the archive's filename extension to oxt.

Installation: When you download the file, the browser should offer an option to install the package.
When you double-click the file in a file manager, the manager should offer an option to install the package.
From within the office: Tools>Extensions... Add...
From command line: <OOo_install_dir>/program/unopkg add somePackage.oxt
Install for all users of this installation:
<OOo_install_dir>/program/unopkg add --shared somePackage.oxt
the latter requires admin privileges.

EDIT: Just noticed that the macro-organizer provides an option to export a library as extension. And then there are some tools http://www.ooomacros.org/dev.php which may help to build customized install routines.


Last edited by Villeroy on Sat Sep 01, 2007 11:32 am; edited 1 time in total
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Thu Aug 30, 2007 4:01 pm    Post subject: Reply with quote

Another way.

In the Basic IDE the two icons on the right let you save a macro as a .bas file and also load a .bas file. Doesn't work if you have a Dialog but otherwise you can just save it that way and open the file on the other machine in a new Module.
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