Downloading macros to import
Macros are available for download. Some macros are contained in documents, some as regular
files that you must select and import, and some as macro text that should be copied and pasted
into the Basic IDE. See “Adding a macro” on page 351 on how to add macros to your macro library
and “Viewing and editing macros” on page 355 on how to edit macros using the Basic IDE.
Some macros are available as free downloads on the Internet (see Table 340).
Table 8. Macro examples
Location Description
http://www.pitonyak.org/oo.php Reference materials regarding macros.
http://www.pitonyak.org/database/ Reference materials regarding database macros.
https://wiki.documentfoundation.org/Macros Lots of links to macros.
http://en.libreofficeforum.org/
http://forum.openoffice.org/en/forum/
Forums, with many examples and help.
How to run a macro
Although you can use Tools > Macros > Run Macro to run all macros, this is not efficient for
frequently run macros. See “Running a macro” on page 354 for more information.
A more common technique for frequently used macros is to link the macro to a toolbar icon, menu
item, keyboard shortcut, or a button embedded in a document. While choosing a method, it is also
good to ask questions such as:
• Should the macro be available for only one document, or globally for all documents?
• Is the macro for a specific document type, such as a Calc document?
• How frequently will the macro be used?
The answers will determine where to store the macro and how to make it available. For example,
you will probably not add a rarely used macro to a toolbar. To help determine your choices, see
Table 341.
Table 9. Where to store a macro
Type of macro LibreOffice (for all
components)
A specific
document type
One document
Toolbar No Yes Yes
Menu No Yes Yes
Shortcut Yes Yes No
Event Yes No Yes
Toolbars, menu items, and keyboard shortcuts
To add a menu item, keyboard shortcut, or toolbar icon that calls a macro, use the Customize
dialog (Figure 348). The Customize dialog contains pages to configure menus, keyboard shortcuts,
toolbars, and events. To open this dialog, go to Tools > Customize on the main menu bar or right-
click in an empty space on a toolbar and select Customize Toolbar from the context menu.
Chapter 13 Getting Started with Macros | 365