von Simon23 » Sa, 18.08.2007 10:39
Hallo,
ich würde gerne meine Calc Dokumente per Makro ohne Schreibschutz öffnen.
Wenn ich sie so (mit schreibschutz) öffne, kommt keine Fehlermeldung und das Dokumet wird geöffnet.
Code: Alles auswählen
Sub Main
Dim sUrl1 as string
Dim myProps(0) as New com.sun.star.beans.PropertyValue
sUrl1 = convertToURL("C:\TestA.ods")
myProps(0).Name="ReadOnly"
myProps(0).Value = true
oDocument = StarDesktop.loadComponentFromURL(sUrl1, "_blank", 0, myProps() )
End Sub
Setze ich jedoch den ReadOnly Wert auf false kommt immer eine Fehlermeldung:
Code: Alles auswählen
Sub Main
Dim sUrl1 as string
Dim myProps(0) as New com.sun.star.beans.PropertyValue
sUrl1 = convertToURL("C:\TestA.ods")
myProps(0).Name="ReadOnly"
myProps(0).Value = false
oDocument = StarDesktop.loadComponentFromURL(sUrl1, "_blank", 0, myProps() )
End Sub
"URL seems to be an unsupported one"
Was mache ich falsch?
Hallo,
ich würde gerne meine Calc Dokumente per Makro ohne Schreibschutz öffnen.
Wenn ich sie so (mit schreibschutz) öffne, kommt keine Fehlermeldung und das Dokumet wird geöffnet.
[code]
Sub Main
Dim sUrl1 as string
Dim myProps(0) as New com.sun.star.beans.PropertyValue
sUrl1 = convertToURL("C:\TestA.ods")
myProps(0).Name="ReadOnly"
myProps(0).Value = true
oDocument = StarDesktop.loadComponentFromURL(sUrl1, "_blank", 0, myProps() )
End Sub
[/code]
Setze ich jedoch den ReadOnly Wert auf false kommt immer eine Fehlermeldung:
[code]
Sub Main
Dim sUrl1 as string
Dim myProps(0) as New com.sun.star.beans.PropertyValue
sUrl1 = convertToURL("C:\TestA.ods")
myProps(0).Name="ReadOnly"
myProps(0).Value = false
oDocument = StarDesktop.loadComponentFromURL(sUrl1, "_blank", 0, myProps() )
End Sub
[/code]
[i]"URL seems to be an unsupported one"[/i]
Was mache ich falsch?