Working with Apache OpenOffice Documents

From Apache OpenOffice Wiki
< Documentation‎ | BASIC Guide
Revision as of 09:15, 13 September 2009 by BMarcelly (Talk | contribs)

Jump to: navigation, search


The Apache OpenOffice API has been structured so that as many of its parts as possible can be used universally for different tasks. This includes the interfaces and services for creating, opening, saving, converting, and printing documents and for template administration. Since these function areas are available in all types of documents, they are explained first in this chapter.

Important note

In the next pages of the Basic Programming Guide you will see these instructions :

Dim Doc As Object
 
Doc = StarDesktop.CurrentComponent

This correct code has a drawback : it does not work if the macro is started from the IDE because it then refers to the IDE, not the document. This code works only if the macro is started from the document itself!

You should instead use Basic instruction ThisComponent. It refers to the document where the macro is run. ThisComponent will correspond to the document window immediately beneath the IDE window if you start the macro from the IDE.

Dim Doc As Object
 
Doc = ThisComponent ' recommended coding for Basic


Content on this page is licensed under the Public Documentation License (PDL).
Personal tools