Hi juergen > the reason is that ThisComponent.getCurrentController returns not the > controller of the expected document. You run the macro when opening the > document and at this time the ThisComponent is probably set ot something > else. It is always a little bit tricky with ThisComponent.getCurrentXXX > methods. It's better to iterate over all frame/controllers and check if > the name is whatever.odt to ensure that you work with the right document.
I've never had such problems with macro stored inside documents ThisComponent has been always pointing on the right one Btw, what means the 23 third argument ? did you try this StarDesktop.loadComponentFromURL("private:factory/swriter", "_blank",23, args) Laurent -- Laurent Godard <[EMAIL PROTECTED]> - Ingénierie OpenOffice.org - http://www.indesko.com Nuxeo Enterprise Content Management >> http://www.nuxeo.com - http://www.nuxeo.org Livre "Programmation OpenOffice.org", Eyrolles 2004-2006 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]