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

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 442
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 385
10) Press Backspace twice to remove the two trailing spaces.
11) Press Home to move the cursor to the start of the line.
12) Press Ctrl+V to paste the selected number to the start of the line.
13) Pasting the value also pasted an extra space, so press Backspace
to remove the extra space.
14) Press Tab to insert a tab between the number and the name.
15) Press Home to move to the start of the line.
16) Press down arrow to move to the next line.
17) Stop recording the macro and save the macro.
It takes much longer to read and write the steps than to record the
macro. Work slowly and think about the steps as you do them. With
practice this becomes second nature.
The generated macro has been modified to contain the step number in
the comments to match the code to the step above.
Listing 2: Copy the numeric value to the start of the column.
sub CopyNumToCol1
rem -------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem -------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem (2) Press Ctrl+Right Arrow to move the cursor to the start of “specifies”.
dispatcher.executeDispatch(document, ".uno:GoToNextWord", "", 0, Array())
rem (3) Press Backspace twice to remove the tab and the space.
dispatcher.executeDispatch(document, ".uno:SwBackspace", "", 0, Array())
rem -------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:SwBackspace", "", 0, Array())
rem (4) Press Tab to add the tab without the space after the constant name.
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "Text"
args4(0).Value = CHR$(9)
dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args4())
rem (5) Press Delete to delete the lower case s ....
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, Array())
rem (5) ... and then press S to add an upper case S.
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "Text"
args6(0).Value = "S"
386 Getting Started with OpenOffice.org 3.x
Free eBook Edition
Vista de pagina 385
1 2 ... 381 382 383 384 385 386 387 388 389 390 391 ... 441 442

Comentarios a estos manuales

Sin comentarios