Maxime Thieu wrote: > Hello all, > > I have a little problem: > > I have a document 'B' which countains a macro > I want to open document 'B' form another document with a macro (with > the function LoadComponentURL). > > It works fine (the doc is opened), but the macro in document 'B' is > disabled... (and I am not asked for enabling macro when the doc 'B' is > automatically opened...) > > Is it a bug ?
No, it's perhaps a missing documentation. Per default macro execution is disabled when you load a document via loadComponentFromURL(). The main reason is that when you execute scripts you usually don't want to have dialogs popping up that interupt your script. Macros very often are used to open a dialog when the document is loaded, so macro execution should be disabled except if it is explicitly asked for. You can ask for it by adding two parameters to the sequence of arguments you add to the loadComponentFromURL call, MacroExecutionMode and UpdateDocMode. The former can take values described in the constant set com.sun.star.document.MacroExecMode, the latter one can take values from the constant set com.sun.star.document.UpdateDocMode. As an example, MacroExecutionMode=2(ALWAYS_EXECUTE) and UpdateDocMode=3(FULL_UPDATE) will allow to execute every macro without confirmation. Please note that UpdateDocMode also allows for other updates that might happen on loading (updating of links, styles from templates etc.). HTH, Mathias -- Mathias Bauer - OpenOffice.org Application Framework Project Lead Please reply to the list only, [EMAIL PROTECTED] is a spam sink. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]