[Solved] Sharing macros with users on different systems

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
ginestre
Posts: 18
Joined: Fri Apr 18, 2008 8:52 pm

[Solved] Sharing macros with users on different systems

Post by ginestre »

In order to solve a specific problem at work, I've developed some macros, and customised the toolbar to launch them. They basically involve allowing the user to choose an external files to load into the current document. The external files are all just open office writer files with some text, all stored in the same GetTemplates directory.

Now I've fallen over at what I thought would be the easy bit: I can't find a way to give my colleagues the fruits of my work, so that they can use them.

I have developed them on my machine (Ubuntu linux running OOo 2.3), with my GetTemplates directory under /Home. Some of my colleagues use the same set up, but most use WinXP.

Can someone point me at a simple set of instructions for packaging, distributing and instaling these macros and the customised toolbar for Windows and Linux colleagues? I thought it would be easy, but I've spent hours and hours over the last three days failing to find a solution. Most of the pages I've found bear no relation at all to what I find on screen.

TIA
Last edited by Hagar Delest on Tue Aug 05, 2008 2:25 pm, edited 1 time in total.
Reason: tagged the thread as Solved.
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: sharing macros with other users on different systems

Post by Hagar Delest »

I just tried that extension and it works beautifully: BasicAddonBuilder - The Extension's packager.

Thanks to add '[Solved]' at beginning of your first post title (edit button) if your issue has been fixed.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
ginestre
Posts: 18
Joined: Fri Apr 18, 2008 8:52 pm

Re: sharing macros with other users on different systems

Post by ginestre »

Thanks for that reply. I have downloaded the BasicAddonBuilder, which looks interesting, and even updated to OOo 2.4- as well as installing the extension. But there are no instructions, and I still don't know in practical terms what to do! I have my macros and my menus in OOo 2.4, and the extension has been installed- but what do I do now? How do I make it work?
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: sharing macros with other users on different systems

Post by Villeroy »

Define generic add-on menus and toolbars rather than your own ones. The menus can be main menus (behind "Help") or below "Tools>Add-Ons". Unfortunately the toolbars get generic titles "Add-On 1", "Add-On 2",...
This is defined in Addon.xcu quite easily. If I remember correctly the BasicAddonBuilder can do this for you. If all of your macros apply to certain templates, it should be possible to store all code, menues and toolbars in the respective templates and distribute the templates as extension.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
bhmt
Posts: 78
Joined: Wed Nov 28, 2007 7:35 pm

Re: sharing macros with other users on different systems

Post by bhmt »

ginestre wrote:But there are no instructions, and I still don't know in practical terms what to do!

How do I make it work?
 Edit: Anyway, in this case I do see some instructions, but lower on the on the download page. Look for

Create an OpenOffice.org extension the easy way with BasicAddonBuilder (Linux.com) and

OpenOffice.org wiki 
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: sharing macros with other users on different systems

Post by Hagar Delest »

I've run the extension without reading any help file, it's really easy, just launch it and follow the steps.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
kingfisher
Volunteer
Posts: 2123
Joined: Tue Nov 20, 2007 10:53 am

Re: sharing macros with other users on different systems

Post by kingfisher »

If all else fails, you can use the macro editor (last icon on the macro tool-bar) to export each module to a bas file, copy the files to the other systems and import each file to a module using the penultimate icon on the same tool-bar.
Apache OpenOffice 4.1.9 on Linux
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: sharing macros with other users on different systems

Post by Villeroy »

Any ODF document can be seen as a package. As I mentioned above you can distribute macros and toolbars together with the file templates they are related to. If macros are not specific to templates, you can put them into their own libraries (not "Standard") within some nice manual document. Menu:Tools>Macros>Organize>Basic...[Organize...], tab:"Libraries", button [Import...] lets you import any document's libraries into global container "My Macros".
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: sharing macros with other users on different systems

Post by Hagar Delest »

The problem with the import of libraries is that if there is a dialog (a GUI) for the macro, it won't work because the links for the dialog buttons will still point to the modules in the document instead of the application. That's why making an extension is safer IMHO.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
Post Reply