English (UK)

Macro for OpenOffice

From: www.tutorialsforopenoffice.org

A Macro is a sequence of keystrokes that are recorded (saved) and given a name. When the Macro is run (selected) by a few keystrokes, the recorded keystrokes are “automatically” performed.

Write a macro

Click File > New > Text Document

Click Tools > Macros > Record Macro

A small window appears towards the top of the screen with the message: This window is present when a macro is being recorded.

For example:

Click the Centered, icon on the Formatting Toolbar.

Type John Doe. Press Enter.

Type 200 Main Street. Press Enter;

Type Springfield. Press Enter.

Type New York. Press Enter.

Type 99999. Press Enter.

Click on Stop Recording.

The “OpenOffice.org Basic Macros” window appears.

In the Macro name dialog box, delete Main then type Address.

Click the New button.

“My Macros& Dialogs Standard – OpenOffice.org" window will appear.

Close the window by clicking on the X in the upper right corner.

Run a macro

Press Enter to move the cursor down one line.

Click Tools > Macros > Organize Macros > OpenOffice.org Basic. (The “OpenOffice.org Basic Macros” window appears.)

In the Existing macros in: Module 1 dialog box, highlight (select) Address. Click the Run button. (The name and address typed in Step 4 in the exercise above appears in your document.)

Edit a macro

Click Tools > Macros > Organize Macros > OpenOffice.org Basic. (The “OpenOffice.org Basic Macros” window appears.)

In the Existing macros in: Module 1 dialog box, highlight (select) Address. Click the Edit button. (The “[My Macros & Dialogs].Standard” window appears. The coding of the macro definition program named “Address” appears. The steps in the program are separated by dashes.)

Scroll down to find the characters which are to be edited. Find the address “200 Main St.” (The lines in the macro definition program are in red and are between quotation marks.)

Move the cursor into the item which is to be edited and click it. (The cursor is blinking in the item.)

Delete letters, symbols, etc. as usual and type the new letters, symbols, etc. (For example, click the address “200 Main St.” delete all those characters and type 1111 Jefferson Ave.” The typed characters are entered into the edited line.)

Click File > Save and then click File > Close.