| View previous topic :: View next topic |
| Author |
Message |
jgperrin General User


Joined: 28 Jul 2005 Posts: 10 Location: Haguenau, Alsace, France
|
Posted: Fri Aug 05, 2005 6:17 am Post subject: [Basic] How to open a document in readonly? |
|
|
Hi,
I managed to have a macro run when I open a document, howeverm I'd like to have this document readonly (w/o changing the filesystem properties!)...
Any idea? |
|
| Back to top |
|
 |
kiru General User

Joined: 16 Dec 2003 Posts: 28 Location: Bucharest, Romania
|
Posted: Fri Aug 05, 2005 6:40 pm Post subject: |
|
|
Try open it in ReadOnly mode. See service MediaDescriptor in SDK. The PropertyValue of a document can have optional property "ReadOnly"
For example:
| Code: | Public Doc as Object
doc1 = convertToURL("C:\test\test.odt")
dim args(1) as new com.sun.star.beans.PropertyValue
args(0).name = "MacroExecutionMode"
args(0).value = 2
args(1).name = "ReadOnly"
args(1).value = True
Doc = StarDesktop.LoadComponentFromURL(doc1, "_blank", 0, args() ) |
Hope this help you.
kiru |
|
| Back to top |
|
 |
|