| View previous topic :: View next topic |
| Author |
Message |
NDog Newbie

Joined: 23 Nov 2005 Posts: 1
|
Posted: Wed Aug 29, 2007 5:19 pm Post subject: Export MyMacro to another OpenOffice Machine |
|
|
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 |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Thu Aug 30, 2007 6:28 am Post subject: |
|
|
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 |
|
 |
JohnV Administrator

Joined: 07 Mar 2003 Posts: 8976 Location: Lexinton, Kentucky, USA
|
Posted: Thu Aug 30, 2007 4:01 pm Post subject: |
|
|
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 |
|
 |
|