|
|
The 5 Steps to Creating an OpenOffice MacroHow to Start Writing OpenOffice.org Macros in just Five Simple StepsOpenOffice Macros can appear intimidating to start with, but they're not - in just five easy steps any user can start developing their own macros.
It's quite often that users moving from Microsoft Office to OpenOffice.org may want to start writing macros but are put off by the apparently complexity of doing so; and that's a shame, because it's neither difficult, nor complicated. In fact, there are just five simple steps to writing any OpenOffice Macro. Step 1: Starting OpenOfficeOpenOffice has its own built in programming language (Basic) and its own built in IDE (Integrated Design Environment). The first step, therefore, is for the user to start OpenOffice by either:
Step 2: Starting the IDEHaving started OpenOffice then next step is to start the IDE - and this can be done from the OpenOffice menu by clicking on:
Step 3: Choosing Where to Save the MacroThis is actually the most off-putting stage - not because it is difficult, but because it uses terms that the new user may find confusing. The user is presented with a few possible locations in which to create a macro:
Obviously there is only a choice between My Macros and one of the documents, but which should the user choose? To make that decision there is a simple rule of thumb:
Step 4: Libraries and ModulesAs well as deciding which area to save the macro in, the user must decide which library and which module the macro should be in, and to do that they must understand what a library or a module is:
Tip: It is tempting for the new user to allow OpenOffice to name all of the libraries and modules, but this should be avoided. It is better for the user to get into the habit of naming libraries and modules appropriately - giving them names that will still mean something in six months or a year. So rather than Library1 and Module1 use something like libGlobalDomination and modFinancialWizard. Step 5: The Macro ItselfFinally the macro can be written - in fact OpenOffice kindly writes one for the new user. Unfortunately it doesn't do anything - it's just a dummy macro: Sub Main End Sub However, it does show how Subs (subroutines) should be defined, and this can quickly be modified to create the user's first (and obligatory) Hello World macro: Sub Main msgbox "Hello World" End Sub And so, with just 5 steps an average OpenOffice user can be turned into a full blown computer geek.
The copyright of the article The 5 Steps to Creating an OpenOffice Macro in Office/Business Software is owned by Mark Alexander Bain. Permission to republish The 5 Steps to Creating an OpenOffice Macro in print or online must be granted by the author in writing.
|
|
|
|
|
|
|
|