your assumption was right! I did search in the developer docs on this,
but got a bit lost.

Thanx a lot !


for the record, this is how I did it:



PropertyValue[] myProperties = new PropertyValue[3];
        myProperties[0] = new PropertyValue();
        myProperties[0].Name = "Hidden";
        // for open document and do not show user interface use "true"
        myProperties[0].Value = new Boolean(false);
        
        myProperties[1] = new PropertyValue();
        myProperties[1].Name =  "MacroExecutionMode";
        myProperties[1].Value =  new 
Short(MacroExecMode.ALWAYS_EXECUTE_NO_WARN);
        
        myProperties[2] = new PropertyValue();
        myProperties[2].Name =  "UpdateDocMode";
        myProperties[2].Value =  new Short(UpdateDocMode.ACCORDING_TO_CONFIG);
        
        // Load a given document
        try     {
                 xComponent = xComponentLoader.loadComponentFromURL(
                                source_File,  // For createUNOFileURL see:
../Office/Office.CreateUNOCompatibleURL.snip
                                "_blank",                       // New windos
                                0,                              // Is ignored
                                myProperties);            // Special properties
        }




On 2/15/07, Mathias Bauer <[EMAIL PROTECTED]> wrote:
Dominique De Munck schrieb:

> Hi,
>
> I'm using the Java bootstrap method to open a OO Writer document as
> described in:
>
> 
http://codesnippets.services.openoffice.org/Office/Office.BootstrapOpenOffice.snip
>
>
> However, when there are macros included in the document that I'm opening,
> the user gets no Alert that the document contains macro's. The macros
> are present, but they do nothing when the users calls them via the OO GUI.
> When opening openoffice normally via Windows, I get  a warning, and
> the macros work.
>
> I tried to play with the macro security settings but to no avail.
>
> Can I solve this problem programmaticly, or is this a bug ?

I assume that you didn't specify the MacroExecMode:

http://api.openoffice.org/docs/common/ref/com/sun/star/document/MacroExecMode.html

It has to be provided in the MediaDescriptor (the arguments sent with
the loadComponentFromURL call) as described at

http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/OfficeDev.xhtml#1_1_5_Handling_Documents

You also should add the DocumentUpdateMode.

http://api.openoffice.org/docs/common/ref/com/sun/star/document/UpdateDocMode.html

Ciao,
Mathias


--
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[EMAIL PROTECTED]".
I use it for the OOo lists and only rarely read other mails sent to it.

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



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

Reply via email to