Primi passi con le Macro

From Apache OpenOffice Wiki
Jump to: navigation, search






Traduzione in corso - translation in progress




Creazione della prima macro

Una macro è una sequenza di comandi o tasti memorizzata per un utilizzo successivo. Ad esempio, una macro è quella che “digita” il vostro indirizzo. Il linguaggio macro di OpenOffice.org è molto flessibile e permette l'automazione di attività sia semplici sia complesse. Le macro sono particolarmente utili per eseguire un'azione ricorrente lungo tutto il documento.

Le macro di OpenOffice.org sono scritte solitamente in un linguaggio chiamato StarBasic, o più brevemente Basic. Sebbene si possa imparare direttamente il Basic per scrivere delle macro, la curva di apprendimento per crearle direttamente col codice è abbastanza ripida. Il metodo più semplice per un principiante è quello di utilizzare il registratore di macro, che registra i tasti premuti e li memorizza per utilizzarli in seguito.

La maggior parte delle attività in OpenOffice.org è portata a termine dall'invocazione di un comando (la sua esecuzione), che viene recepito e utilizzato. Il registratore di macro funziona registrando i comandi che vengono invocati (fate riferimento a "(UNDEFINED REFERENCE: "The dispatch framework section")” alla pagina (UNDEFINED REFERENCE: "The dispatch framework section")).






This is Chapter 13 of Getting Started with OpenOffice.org 3.x, produced by the OOoAuthors group. A PDF of this chapter is available from this wiki page.


Your first macro

A macro is a saved sequence of commands or keystrokes that are stored for later use. An example of a simple macro is one that “types" your address. The OpenOffice.org macro language is very flexible, allowing automation of both simple and complex tasks. Macros are especially useful to repeat a task the same way over and over again.

OpenOffice.org macros are usually written in a language called StarBasic, or just abbreviated Basic. Although you can learn Basic and write macros, there is a steep learning curve to writing macros from scratch. The usual method for a beginner is to use the built-in macro recorder, which records your keystrokes and saves them for use.

Most tasks in OpenOffice.org are accomplished by “dispatching a command" (sending a command), which is intercepted and used. The macro recorder works by recording the commands that are dispatched (see The dispatch framework).


Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).
Personal tools