OpenOffice.org OpenOffice - 3.2 Guía de inicio rápido Pagina 388

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 442
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 387
Cursor movements are used for all operations (as opposed to
searching). If run on the DONTKNOW line, the word weight is moved
to the front of the line, and the first “The” is changed to “She”. This is
not perfect, but I should not have run the macro on the lines that did
not have the proper format; I need to do these manually.
Running the macro quickly
It is tedious to repeatedly run the macro using Tools > Macros > Run
Macro (see Figure 302). The macro can be run from the IDE. Use
Tools > Macros > Organize Macros > OpenOffice.org Basic to
open the Basic Macro dialog. Select your macro and click Edit to open
the macro in the IDE.
The IDE has a Run Basic icon in the toolbar that runs the first macro
in the IDE. Unless you change the first macro, it is the empty macro
named Main. Modify Main so that it reads as shown in Listing 3.
Listing 3: Modify Main to call CopyNumToCol1.
Sub Main
CopyNumToCol1
End Sub
Now, you can run CopyNumToCol1 by repeatedly clicking the Run
Basic icon in the toolbar of the IDE. This is very fast and easy,
especially for temporary macros that will be used a few times and then
discarded.
Sometimes the macro recorder fails
Understanding the OpenOffice.org internals helps to understand how
and why the macro recorder frequently fails. The primary offender is
related to the dispatch framework and its relationship to the macro
recorder.
The dispatch framework
The purpose of the dispatch framework is to provide a uniform access
to components (documents) for commands that usually correspond to
menu items. I can use File > Save from the menu, the shortcut keys
Ctrl+S, or click on the Save toolbar icon. All of these commands are
translated into the same “dispatch command”, which is sent to the
current document.
388 Getting Started with OpenOffice.org 3.x
Free eBook Edition
Vista de pagina 387
1 2 ... 383 384 385 386 387 388 389 390 391 392 393 ... 441 442

Comentarios a estos manuales

Sin comentarios