dubailobi.blogg.se

Openoffice basic macros
Openoffice basic macros












openoffice basic macros

Next, in the Category list of the bottom section, find the module containing your macro. In the top section, choose the keystroke you want to assign. To assign a key combination to a macro you use the Keyboard tab of the Configuration dialog (Tools | Configure on the menu). Macros can also be called in a variety of other places, such as during validation in a spreadsheet. You can also run a macro when an event occurs on a form. It’s likely a macro you can use in this way is one you write yourself (see “How do I create a macro other than recording it?” below) rather than one you record. For example, if you have a macro that computes the cube root of a number, assuming it’s called CubeRoot, a formula could use it like this: In addition, the macro should be stored in the spreadsheet itself, so it’s always available. In this case, the macro must return a value appropriate for use in a spreadsheet. The formula should refer to the macro by name and pass any required parameters. You can use a keystroke to run a macro (see “How do I assign a keystroke to a macro?” below) or put a button to call the macro on a toolbar (see “How do I put a macro on a toolbar?”).Ī formula in a spreadsheet can use a macro directly. Navigate to the macro you want to run and click the Run button. The most obvious is to access it from the menu, using Tools | Macros | Macro… to open the Macro dialog. Once a macro is defined (whether by recording it or creating it with code), there are a number of ways to run it. Once you save one macro with a particular document or template, you can choose the Module1 module to save additional macros there. The first time you save a macro to a particular document or template, you are prompted to specify the module either accept the default Module1 or supply a meaningful name. To store a macro with a document or template, find the document in the left list of the dialog, and click the Standard item for that document. By default, macros you record are stored for all of OOo in the Module1 module of the Standard library of OOo.

openoffice basic macros openoffice basic macros

You can store macros with itself or with individual documents or templates. The name may not include spaces or a variety of other punctuation characters. The Macro dialog appears for you to name the macro and indicate where to store it.

OPENOFFICE BASIC MACROS SERIES

For example, if you record an action to apply to a series of words, lines, or paragraphs one at a time, make sure you leave the cursor at the beginning of the next word, line, or paragraph.) Once you perform all the actions that constitute the macro, click the Stop Recording button. (Remember to leave the cursor positioned where you want it to be once the macro finishes. Now, perform the action exactly as you want it recorded, including any cursor movements, choices from the menu, shortcut menu or toolbars, and so forth. Choose Tools | Macros | Record Macro from the menu. There’s some discussion of creating one, but due to the complexity of the task, it’s not likely to happen any time soon.īefore recording a macro, make sure your document is set up as you want it, including putting the cursor where the action you’re recording begins. At this time, no mechanism exists for converting Office macros to OOo macros. Unfortunately, uses a different version of Basic than Microsoft Office, so macros created in Office won’t work in OOo. Once you define a macro either way, you can assign a keystroke to it and/or put it on a toolbar to make it instantly available. Earlier versions have no macro recorder.) The second choice is to write it yourself using the Basic language. The first is to record a macro, where you perform the desired action with OOo “watching.” (The ability to record macros was added in 1.1. Ĭan I use macros to simplify repeated actions? This article is excerpted from the recently published book OOsSwitch: 501 Things You Wanted To Know About Switching to from Microsoft Office. It lets another application control OOo and make things happen without user intervention. macros allow you to save a sequence of operations with a single name so you can do the same thing repeatedly.

  • OpenOffice.There are times when you need to perform some task over and over, or when a task is complex enough that doing it manually makes it hard to get it right.
  • openoffice basic macros

    CreateSpace Independent Publishing Platform. SupportsService ( ".Paragraph" ) Then Count = Count + 1 End If Wend 'Display result MsgBox Count, 0, "Paragraph Count" End Sub See also NextElement ' Is the component a paragraph? If TextEl. SupportsService ( ".TextDocument" ) Then MsgBox "This macro must be run from a text document", 64, "Error" Exit Sub End If Count = 0 ' Examine each component - paragraph or table? Enum = Doc. Sub ParaCount ' ' Count number of paragraphs in a text document ' Dim Doc As Object, Enum As Object, TextEl As Object, Count As Long Doc = ThisComponent ' Is this a text document? If Not Doc.














    Openoffice basic macros