Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I always like to look into things I don't understand and this is one I hadn't looked at before, so take this with a grain of salt.

I found little on the subject anywhere. Service Reference and some sparse info in OOME (pdf here) on page 314 (document page 317). I also added the following code to yours after ThisDoc... and just before the MRI inspection:

    On Error Resume Next
Dim vArgs   'Media descriptor as an array of com.sun.star.beans.PropertyValue
Dim s$      'Display string
Dim i%      'Index variable
REM Obtain the media descriptor. It turns out that this
REM can be represented as an array of PropertyValue services.
vArgs = ThisComponent.getArgs()
For i = 0 To UBound(vArgs)          'For each property
    s = s & vArgs(i).Name & " = "       'Add the property name and an equals sign
    s = s & vArgs(i).Value              'Obtaining the value may fail!
    s = s & CHR$(10)                    'Add a new-line character
Next
MsgBox s,0, "Args"

Code is from OOME book. Display 1:

image description

Notice DocumentTitle. Although my code specified "NewTestTitle", "Form1" was the actual sending document AND when args was viewed in MRI it showed "NewTestTitle". Other items like "ReadOnly" set to "False" didn't do anything.

Based on the limited information available the most important item was from the noted OOME:

TIP
If you know how to open a document using the GUI, but are uncertain how the arguments must be set to load the document using loadComponentFromURL, then first load the document using the GUI, then inspect the document's media descriptor. Hint: look at FilterOptions.

From what I can see, arguments sent are only what is necessary to open the document. There seem to be a select few as optional (such as "ReadOnly" and "MacroExecutionMode") but I haven't tried them all.

This doesn't answer all your questions (nor mine) but hopefully a bit more understanding and maybe direction.

I always like to look into things I don't understand and this is one I hadn't looked at before, so take this with a grain of salt.

I found little on the subject anywhere. Service Reference and some sparse info in OOME (pdf here) on page 314 (document page 317). I also added the following code to yours after ThisDoc... and just before the MRI inspection:

    On Error Resume Next
Dim vArgs   'Media descriptor as an array of com.sun.star.beans.PropertyValue
com.sun.star.beans.PropertyValue'
Dim s$      'Display string
string'
Dim i%      'Index variable
variable'
REM Obtain the media descriptor. It turns out that this
REM can be represented as an array of PropertyValue services.
vArgs = ThisComponent.getArgs()
For i = 0 To UBound(vArgs)          'For each property
property'
    s = s & vArgs(i).Name & " = "       'Add the property name and an equals sign
sign'
    s = s & vArgs(i).Value              'Obtaining the value may fail!
fail!'
    s = s & CHR$(10)                    'Add a new-line character
character'
Next
MsgBox s,0, "Args"

Code is from OOME book. Display 1:

image description

Notice DocumentTitle. Although my code specified "NewTestTitle", "Form1" was the actual sending document AND when args was viewed in MRI it showed "NewTestTitle". Other items like "ReadOnly" set to "False" didn't do anything.

Based on the limited information available the most important item was from the noted OOME:

TIP
If you know how to open a document using the GUI, but are uncertain how the arguments must be set to load the document using loadComponentFromURL, then first load the document using the GUI, then inspect the document's media descriptor. Hint: look at FilterOptions.

From what I can see, arguments sent are only what is necessary to open the document. There seem to be a select few as optional (such as "ReadOnly" and "MacroExecutionMode") but I haven't tried them all.

This doesn't answer all your questions (nor mine) but hopefully a bit more understanding and maybe direction.