Hi Christian,

> method 1: works only before I reopen the document.
>           The control editor show no events attached

that's because when you register a listener created by
CreateUnoListener, then it is not persistent. You would need to add some
macro to the OnLoad event of the whole document, where you do the
CreateUnoListener thingie. However, this is somewhat error prone, as you
never know when Basic will internally free this listener. As far as I
know, the listener can become non-functional when you have a compile
error in the Basic module, or something like this ....

> method 2: does not work at all
>           The control editor show the document:.. stuff but there is an
>           error executing the macro due to wrong format
>           After I reopen the macro the control editor is "empty"
> method 3: works only before I reopen the document.
>           The control editor show the vnd.sun... stuff
>           After I reopen the macro the control editor is "empty"

That's strange. You might want to try examining the content.xml of the
(unzipped) document, comparing the document where you added the listener
programmatically with the one where you added it via UI. Is there any
difference?

IIRC, both syntaxes should be supported for compatibility reasons.

You also might want to try examining what getScriptEvents gives you (for
a control where you assigned the macro via UI) - don't rely too much on
what the property browser shows, it might be tweaked.

> what I find strange is that on windoes OOo2.0.4 the vnd.sun.star is not
> working, but this is working on linux OOo2.0.4

that's strange indeed, and I don't have any clue here ...

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Base                       http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to