Macro to open/close a document

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
CharlesLewis50
Posts: 6
Joined: Fri Jun 06, 2008 5:41 pm

Macro to open/close a document

Post by CharlesLewis50 »

I am a raw beginning to OpenOffice software, having used WordPerfect for many years. I will soon be switching to Mac, however, and so I am trying to learn this program as the best alternative to what I know -- I have no interest in MS Write!

In WP, I had a macro that would save a document under the same name without prompting me for replacement and another that would open a specific folder for frequently used documents. I have been trying to re-create these with OC but once the document closes or opens, the macro I am trying to record simply disappears. I assume it is tied to the current document, though I am not sure if that is the reason.

This is surely a common task, so I am hoping someone here can guide me how to succeed or else lead me to a macro that already does this. (Or perhaps there is a way to do this within the different options that I haven't yet discovered.)

Thanks for any help you can provide.

Charles
TerryE
Volunteer
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: Macro to open/close a document

Post by TerryE »

This depends on where you store your macro. It you put in in the current document, then you will loose visibility when you close the document. If you use the Organiser to create a module in [My Macros and Dialogues], it will always be accessible.
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
CharlesLewis50
Posts: 6
Joined: Fri Jun 06, 2008 5:41 pm

Re: Macro to open/close a document

Post by CharlesLewis50 »

Thanks, Terry. I appreciate your help, but I suspect I am going to need some remediation. I have read through the PDF documentation about using the Organizer, but can't find anything about creating a module in [My Macros and Dialogues]. If I understand correctly what I have read, the Organizer is a way to create styles that can be imported into later documents, like a header for stationary. Am I in the right section? If so, I'm going to need a little hand holding or a reference to a document that provides more detailed instruction on using the Organizer than the PDF document I have.

I suspect I'll probably spend more time figuring this out than I am going to save for this specific project, but the skills I pick up will help me with other needs down the road. At least that's what happened when I learned how to write macros for WordPerfect.

Any help you can provide would be gratefully accepted!

Charles
OOo 2.4.X on Ms Windows XP
TerryE
Volunteer
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: Macro to open/close a document

Post by TerryE »

Charles, I am talking about the Tools->Macro->Organise path. The fact is that if you want to use macros then this decision involves a commitment to doing a reasonable amount of reading up. There's a sticky post at the top of Macros and UNO API giving references. Also google can provide wonders "+OpenOffice organizing your macros" gave me some good hits on the first screen.
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
CharlesLewis50
Posts: 6
Joined: Fri Jun 06, 2008 5:41 pm

Re: Macro to open/close a document

Post by CharlesLewis50 »

That gives me a good place to start. I'll start doing my homework. Thanks for your help.

Charles
OOo 2.4.X on Ms Windows XP
Post Reply