Werken met documenten van Apache OpenOffice

From Apache OpenOffice Wiki
< NL‎ | Documentation‎ | BASIC Guide
Revision as of 15:40, 28 January 2013 by DiGro (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Book.png

De Apache OpenOffice API is zo gestructureerd dat zo veel mogelijk delen ervan universeel kunnen worden gebruikt voor verschillende taken. Dit geldt ook voor de interfaces en services voor het maken, openen, en printen van documenten en voor beheer van sjablonen. Zij worden als eerste besproken in dit hoofdstuk omdat deze gebieden voor functies beschikbaar zijn in alle typen documenten.

Het huidige document

In previous versions of the Basic Programming Guide these instructions were used to obtain the current document :

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 object ThisComponent. It returns the document object on which the macro is run. If you start the macro from the IDE, ThisComponent will still find and return your document.

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


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