| View previous topic :: View next topic |
| Author |
Message |
OOMacroProgrammer General User

Joined: 07 Jul 2005 Posts: 10
|
Posted: Thu Jul 07, 2005 3:51 am Post subject: OO 2.0: where are menu files and macro library files saved? |
|
|
Hello,
I am new to OpenOffice macros programming. I am using OO version 1.9.87.
I have written a simple macro that displays a messagebox to the user. I want to launch this macro on the click of a menu item.
I have managed to create the menu and assign the macro to the menu.
Now I want to run the same macro on another machine which has OO 1.9.87 installed.
My concerns are:
1. What all files do I need to copy from my machine?
a. File/s for the menu?
b. File/s for the macro library?
2. What steps will I need to carry out on the other machine to be able to run my macro there, viz.. Appending the library and menu?
P.S. I believe there is an menubar.xml file created in <user\config\soffice.cfg\modules\swriter\menubar> in the Open Office.org folder in Documents and Settings folder. Do I have to copy this file to the other machine? Any other dependencies of this file?
But, I couldnot locate the location where my macro library is stored.
It will be of great help if I can get some help on the same. Perhaps a step by step guide on how to create a simple macro with a menu and the files associated to distribute it will be of great help to me so that I can cross-check if I am on the correct track.
Thanks and regards,
OOProgrammer. |
|
| Back to top |
|
 |
pitonyak Administrator


Joined: 09 Mar 2004 Posts: 3618 Location: Columbus, Ohio, USA
|
Posted: Thu Jul 07, 2005 10:25 am Post subject: |
|
|
You are using the 2.0 development release, so you can probably do this directly with the API. This is probably prefered to modifying the XML configuration files directly.
I do not have access to this information, but I think that I have old emails from the dev list with at least one example. I did a quick search of the dev list, but I did not find the examples. I was just looking at them last night and emailed them to someone else... Hmmm.. _________________ --
Andrew Pitonyak
http://www.pitonyak.org/oo.php |
|
| Back to top |
|
 |
OOMacroProgrammer General User

Joined: 07 Jul 2005 Posts: 10
|
Posted: Sun Jul 10, 2005 11:26 pm Post subject: Re:OO2.0: where are menu files and macro library files saved |
|
|
Hello,
Thanks for the help. I actually found an alternate to distribute my macro. This is what I did, please guide me incase I'm doing something wrong!
Step 1: Record a macro and store it in a new library under My Macros. This library gets saved in <C:\Documents and Settings\<username>\Application Data\
OpenOffice.org1.9.87 \user\basic>. A new folder gets automatically created here by the name of the library. Note: The files of this folder are visible only if u exit from OpenOffice and from the QuickStarter in the systray too.
Step 2: Create a new menu using Tools->Customise and save it underOpenOffice.org Writer. The new menu item gets reflected in the xml file stored in the following location: <C:\Documents and Settings\<username>\Application Data\ OpenOffice.org1.9.87\user\config\soffice.cfg\modules\swriter\menubar>
Step 3: Assign the macro recorded in Step 1 to the menu created in Step 2 using Tools->Customise>Menus->Add Commands.
Now, on clicking that particular menu item, the macro is launched.
To run the macro on another machine this is what I did:
Step 1: Replace the menu xml file at the location <C:\Documents and Settings\<username>\Application Data\ OpenOffice.org1.9.87\user\config\soffice.cfg\modules\swriter\menubar>[/b]
Step 2: Copy the macro library to the folder: C:\Program Files\OpenOffice.org 1.9.87\share\basic.
Step 3: Append this library in OO writer using Tools->Macros->Organise Macros->OpenOffice.org basic. Here click Organiser and append the library.
Now when u click on the menu item, the macro is launched.
Is there any catch I'm missing out on in this procedure?
Thanks,
OOProgrammer. |
|
| Back to top |
|
 |
|