Hi Andreas, > The basic property "ThisComponent" is'nt a realy stable feature. > It referrs to the "current document" ... and that can be the problem > here. Do you realy know which of your documents is the "current one" at > the time you call "ThisComponent.getTextFields()" ? > > In general "ThisComponent" should be used only in the following case: > (my personal opinion !) > > a) You have one document containing macros. > b) You register these macros to the event "OnLoad", so they are started > automaticly. > c) Then ThisComponent referrs to THESE document. > d) You dont open any other document or do any action, which can set > ThisComponent to other currently open documents. E.g. a > Frame.ControllerWindow.ToFront(true) (which set the focus to this > window) can make trouble. Because the ThisComponent will be changed to > the document owned by this frame .-)
As far as I know, in case of macros contained in a document, ThisComponent *always* refers to the document itself. Only if your macro is part of some global (application-wide) Basic library, then ThisComponent follows the "current document". This would mean that your above description is way too strict. Ciao Frank -- - Frank Schönheit, Software Engineer [EMAIL PROTECTED] - - Sun Microsystems http://www.sun.com/staroffice - - OpenOffice.org Database http://dba.openoffice.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
