Image by: Sally Peterson

Macros

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

  1. Click File > New > Text Document. (The document appears.)

  2. 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.)

  3. Click the Centered , icon on the Formatting Toolbar. (The cursor moves to the center of the line.)

  4. Type John Doe. Press Enter. Type 200 Main Street. Press Enter; Type Springfield. Press Enter. Type New York. Press Enter. Type 99999. Press Enter. (The five lines are centered on the page.)

  5. Click on Stop Recording. (The “OpenOffice.org Basic Macros” window appears.)

  6. In the Macro name dialog box, delete Main then type Address. Click the New button.

  7. My Macros& Dialogs Standard – OpenOffice.org" window will appear. (See the image under "Edit A Macro, Step Two" below.)

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

Run (Play) A Macro

  1. Press Enter to move the cursor down one line.

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

  3. 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.)

Interrupting Macros

If you want to terminate a macro that is currently running, press Shift+Ctrl+Q.

Edit A Macro

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

  2. 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 -----------.)

  1. 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.)

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

  3. 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.)

  4. Click File > Save and then click File > Close.

Delete A Macro

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

  2. In the “Existing macros in Module1 dialog box, select Address. Click on Delete > Yes > Close. (The macro “Address” is deleted.)

NOTE

Tutorials are improved by input from users. We solicit your constructive criticism.

Click here to E-mail your suggestions and comments

Edited by Sue Barron

Macros        04/27/07

 


Last modified: 2008-04-30 01:42 UTC
Creative Commons License
This work is licensed under a Creative Commons Attribution2.5 License.