Hi Frank, thanks for answering. for method1, I thought this was the reason, sicne nothing got registered in the "events" for the button.
I still cannot see why #2 and #3 is not working though. I've now tested this with OOo 2.1 on Suse 10.1 and I get the same rsult (I' ve created a test document for this if you want to take a look at it yourself..) Frank Schönheit - Sun Microsystems Germany wrote: > 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 > -- Christian Andersson - [EMAIL PROTECTED] Configuration and Collaboration for OpenOffice.org Open Framework Systems AS http://www.ofs.no --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
