

A small dialog is displayed indicating that LibreOffice is recording a macro.Ģ)Type the desired information or perform an appropriate series of operations. By default, this feature is turned off when LibreOffice was installed on your computer.ġ)Go to Tools > Macros > Record Macro on the main menu bar to start recording a macro. Make sure macro recording is enabled by going to Tools > Options > LibreOffice > Advanced on the main menu bar and selecting the option Enable macro recording. See the Writer Guide Chapter 3 Working with Text for more information. To overcome this problem, you can create a macro that enters your repeated information.įor some types of information that you want to repeatedly enter into a document, it may be more convenient to create an AutoText file. This means that you have to re-copy your repeated information. However, if something else is copied to the clipboard, the contents on the clipboard are changed.

If you have to repeatedly enter the same information, you can copy this information after it has been entered into your document for the first time, then paste the information into your document each time you want to use it. Listing 2: Module1 after adding the new macro. Listing 2 shows the new macro has been added before Sub Main.įigure 3: Integrated Development Environment dialog The IDE is a text editor included with LibreOffice that allows you to create and edit macros.ĩ)When a new module is created, it contains a comment and an empty macro named Main, which does nothing.ġ0)Add the new macro either before Sub Main or after End Sub. If you wish, you can click New to create another module in the library.Ĩ)Select Module1, or the new module that you created, and click Edit to open the Integrated Development Environment (IDE) (Figure 3). A module named Module1 already exists and can contain your macro. Use the following steps to create a library to contain your macro:ġ)Use Tools > Macros > Organize Macros > LibreOffice Basic to open the LibreOffice Basic Macro dialog (Figure 1).Ģ)Click Organizer to open the Basic Macro Organizer dialog (Figure 2) and select the Libraries tab.ģ)Set the Location to My Macros & Dialogs, which is the default location.Ĥ)Click New to open the New Library dialog.ĥ)Enter a library name, for example TestLibrary, and click OK.ħ)In the Module list, expand My Macros and select, for example TestLibrary. You must create a library and module to contain your macro see “ Macro organization” on page 15 for more information.

For this example, the macro in Listing 1 is used. This section assumes that you have a macro that you want to use, which may be in an email, on a web page, or even in a book. The first step in learning macro programming is to find and use existing macros. The macro recorder works by recording the commands that are dispatched (see “ Dispatch framework” on page 14). Most tasks in LibreOffice are accomplished by “dispatching a command” (sending a command), which is intercepted and used. The usual methods for a beginner are to use macros that someone else has written or use the built-in macro recorder, which records keystrokes and saves them for use. Although you can learn Basic and write macros, there is a steep learning curve to writing macros from scratch. LibreOffice macros are usually written in a language called LibreOffice Basic, sometimes abbreviated to Basic. Macros are very useful when you have to repeat the same task in the same way over and over again. The LibreOffice macro language is very flexible, allowing automation of both simple and complex tasks. An example of a simple macro is one that “types” your address. Toolbars, menu items, and keyboard shortcutsĪ macro is a saved sequence of commands or keystrokes that are stored for later use. How the macro recorder uses the dispatch framework For a more detailed list, see the application Help.Ĭontrol+click and/or right-click depending on computer setup The table below gives some common substitutions for the instructions in this chapter.
#Ommwriter vs libreoffice mac#
Some keystrokes and menu items are different on a Mac from those used in Windows and Linux. This chapter is based on Chapter 13 of Getting Started with 3.3. Please direct any comments or suggestions about this document to the Documentation Team’s mailing list: Everything you send to a mailing list, including your email address and any other personal information that is written in the message, is publicly archived and cannot be deleted.
#Ommwriter vs libreoffice license#
You may distribute it and/or modify it under the terms of either the GNU General Public License ( ), version 3 or later, or the Creative Commons Attribution License ( ), version 4.0 or later.Īll trademarks within this guide belong to their legitimate owners. This document is Copyright © 2010–2016 by the LibreOffice Documentation Team. Using the Macro Recorder … and Beyond Copyright
