Terry wrote:

[EMAIL PROTECTED] wrote:

Hi there,

I have a master document.
I wanted to have links to subdocuments updated when opening the document, without having to answer a dialog box.
I managed to configure my openoffice "options" to do that and it works.

Now, I have a macro that opens a document thanks to "LoadComponentFromURL".
When I run this macro, the document is opened but links are not updated.

Is there anything else to do after document opening ?

(It is a problem since I run this macro to generate a PDF of my master document, and so I get an empty document).

Thanks in advance

François

Hi, François

Try the following. I can run it but I do not have links that require updating.

For values for the flag see: http://api.openoffice.org/docs/common/ref/com/sun/star/document/UpdateDocMode.html

Dim aProps( 0 ) as new com.sun.star.beans.PropertyValue, sUrl as String
sUrl = "file:///home/terry/Data/Work/DataLog.ods"
If NOT FileExists( sUrl ) Then : Msgbox( "No file named " & sUrl ) : Exit sub : End If
aProps( 0 ).name = "UpdateDocMode"
aProps( 0 ).value = 3 'full update - will call a dialog if required
oDataLog = StarDesktop.loadComponentFromURL( sUrl, "_blank", 0, aProps() )


It works !

The problem for me was that I used the constant name (e.g. FULL_UPDATE) instead of the numerical value (e.g. 3) for the aProps (0) value.

Thanks a lot for your quick answer.

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

Reply via email to