Where are macros stored on OpenOffice.org 3

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
DWFII
Posts: 48
Joined: Sat Jan 09, 2010 3:30 am

Where are macros stored on OpenOffice.org 3

Post by DWFII »

Quick question....

I have macros that I created on one computer(and at least one with help from generous members here) and would like to copy/transfer via a network them to OO 3.3 on another computer. How do I do this?
Open Office 3.3 on Win7 Pro x64
FJCC
Moderator
Posts: 9651
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Where are macros stored on Open Office 3

Post by FJCC »

If they are stored in My Macros the location is a folder in your user profile. On my system that is:
C:\Documents and Settings\username\Application Data\OpenOffice.org\3\user\basic

Application Data is a hidden folder, so you have to make such folders visible.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Where are macros stored on Open Office 3

Post by Villeroy »

[Tutorial] How to install a code snippet
Non-Basic macros are plain text source code.
Basic macros are XML encoded and registered in XML configuration files. Store your Basic in unique libraries (NOT the "Standard" one), call the macro organizer for Basic and export the library to an extension file which can be installed via Tools>Extensions. You can also use the Basic organizer to move your library into a demo document and then import the library using the Basic organizer on the other system.
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
rudolfo
Volunteer
Posts: 1488
Joined: Wed Mar 19, 2008 11:34 am
Location: Germany

Re: Where are macros stored on Open Office 3

Post by rudolfo »

 Edit: Started writing before Villeroy's post from above was availbe. My thoughts are basically the same as his, but in different words -- but sometimes it helps to read something in a second language. 
If the macros are not saved within the document (only possible for OOo Basic macros) they are in your user profile see posting User Profile. That's either in the Basic or in the scripts subdirectory in case the language is not Basic.

Best approach is to open the "Organize Macros" dialog with Alt-F11 and check the "My Macros" section (that's all what is in your User Profile). Anything that is in "OpenOffice Macros" is a macro that comes with the installation of OpenOffice. If you can't find your Macro in "My Macros" you have probably stored them in the documents and then you have to find those documents.
Note: Macros stored in the document can simply be distributed with distributing the document. For macros in your user profile it may be the best way to follow the instructions that are used for copying macro code from this forum: http://user.services.openoffice.org/en/ ... =74&t=5519
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.
DWFII
Posts: 48
Joined: Sat Jan 09, 2010 3:30 am

Re: Where are macros stored on Open Office 3

Post by DWFII »

FJCC wrote:If they are stored in My Macros the location is a folder in your user profile. On my system that is:
C:\Documents and Settings\username\Application Data\OpenOffice.org\3\user\basic

Application Data is a hidden folder, so you have to make such folders visible.

I am using Windows 7 pro x64 on both machines. I am not seeing Documents and Settings.
Open Office 3.3 on Win7 Pro x64
Bill
Volunteer
Posts: 8952
Joined: Sat Nov 24, 2007 6:48 am

Re: Where are macros stored on Open Office 3

Post by Bill »

DWFII wrote:
FJCC wrote:If they are stored in My Macros the location is a folder in your user profile. On my system that is:
C:\Documents and Settings\username\Application Data\OpenOffice.org\3\user\basic

Application Data is a hidden folder, so you have to make such folders visible.

I am using Windows 7 pro x64 on both machines. I am not seeing Documents and Settings.
Your signature says that you are using Windows XP. For Vista or Windows 7, change "C:\Documents and Settings\username\Application Data" to "C:\Users\username\AppData\roaming".
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Where are macros stored on Open Office 3

Post by Villeroy »

DWFII wrote: I am using Windows 7 pro x64 on both machines. I am not seeing Documents and Settings.
If we are talking about Basic macros, the location of the files is not relevant. You can not easily copy Basic code to another machine. It will not show up in the office until you manipulate some additional configuration files.

Tools>Macros>Organize>Basic... button [Organizer] provides everything you need to move, copy, export, import Basic code, given that it does not reside in library "Standard".

Macros that are written in a mature programming language can be organized as source code files in subdirectories without circumstance.
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
DWFII
Posts: 48
Joined: Sat Jan 09, 2010 3:30 am

Re: Where are macros stored on Open Office 3

Post by DWFII »

Bill wrote:
DWFII wrote:
FJCC wrote:If they are stored in My Macros the location is a folder in your user profile. On my system that is:
C:\Documents and Settings\username\Application Data\OpenOffice.org\3\user\basic

Application Data is a hidden folder, so you have to make such folders visible.

I am using Windows 7 pro x64 on both machines. I am not seeing Documents and Settings.
Your signature says that you are using Windows XP. For Vista or Windows 7, change "C:\Documents and Settings\username\Application Data" to "C:\Users\username\AppData\roaming".
You're right...fixed this. Thanks.
Open Office 3.3 on Win7 Pro x64
DWFII
Posts: 48
Joined: Sat Jan 09, 2010 3:30 am

Re: Where are macros stored on Open Office 3

Post by DWFII »

Villeroy wrote:
DWFII wrote: I am using Windows 7 pro x64 on both machines. I am not seeing Documents and Settings.
If we are talking about Basic macros, the location of the files is not relevant. You can not easily copy Basic code to another machine. It will not show up in the office until you manipulate some additional configuration files.

Tools>Macros>Organize>Basic... button [Organizer] provides everything you need to move, copy, export, import Basic code, given that it does not reside in library "Standard".

Macros that are written in a mature programming language can be organized as source code files in subdirectories without circumstance.
I have to admit that I struggle with OO...coming from long years as a WordPerfect user(and none too good at that) but I don't see any options to copy or export my macros in Organizer...
here's a printscreen
here's a printscreen
OOmacros screencap_2.png
As you can see the export function is greyed out. And how does one copy? Just ctrl+c? and past (ctrl+v) across the network? To where?
Open Office 3.3 on Win7 Pro x64
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Where are macros stored on Open Office 3

Post by Villeroy »

Villeroy wrote:Store your Basic in unique libraries (NOT the "Standard" one), ...
Villeroy wrote:
DWFII wrote: Tools>Macros>Organize>Basic... button [Organizer] provides everything you need to move, copy, export, import Basic code, given that it does not reside in library "Standard".
Add your own library, go to the modules and move them. Ctrl+Drag&Drop copies.
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
DWFII
Posts: 48
Joined: Sat Jan 09, 2010 3:30 am

Re: Where are macros stored on Open Office 3

Post by DWFII »

Villeroy wrote:Store your Basic in unique libraries (NOT the "Standard" one), ...
Villeroy wrote: Add your own library, go to the modules and move them. Ctrl+Drag&Drop copies.
OK, I think I understand that (sorry I missed the business about "Standard" libraries). Will I have to do anything else to activate them?
Open Office 3.3 on Win7 Pro x64
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Where are macros stored on Open Office 3

Post by Villeroy »

All the macros you call through script events (buttons, hyperlinks, anything in Tools>Customize) will be loaded on demand.
If your code calls some macro in an unloaded library, all you need to do is loading the library:
GlobalScope.BasicLibraries.loadLibrary("MyHelpers") [does nothing if it is loaded already]
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
Post Reply