sexta-feira, 28 de maio de 2010

Assigning Macros to OpenOffice Events: How to Assign an OpenOffice.org Basic Macro to an Event

Assigning Macros to OpenOffice Events: How to Assign an OpenOffice.org Basic Macro to an Event


Adding an OpenOffice.org macro is a very useful way of extending the functionality of a Calc spreadsheet or a Writer document. For example, a user may wish to time stamp a spreadsheet every time that it's opened - a task that can easily be achieved by adding a macro which the user manually runs whenever they open the spreadsheet. Of course, there are some drawbacks to this:

  • the user must remember to run the macro
  • the user must know how to run the macro
  • the user must want to run the macro.

A much better solution for everyone is to get OpenOffice to do all of the hard work itself - and for that macros can be assigned to events.

OpenOffice.org's Built-in Events

OpenOffice has a number of built-in events that can be used to trigger any macro; these events are:

  • activate document
  • close application
  • close document
  • create document
  • deactivate document
  • document has been save as
  • document has been saved
  • document is closing
  • 'Modified' status was changed
  • open document
  • print document
  • save document
  • save document as
  • start application

So if, for example, the user wants the macro to run whenever they open the document then the trigger event should be 'open document'.

Having decided which is to be the trigger event then next step is to create a macro for that event.

Nenhum comentário: