OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[Basic] How to open a document in readonly?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
jgperrin
General User
General User


Joined: 28 Jul 2005
Posts: 10
Location: Haguenau, Alsace, France

PostPosted: Fri Aug 05, 2005 6:17 am    Post subject: [Basic] How to open a document in readonly? Reply with quote

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
View user's profile Send private message
kiru
General User
General User


Joined: 16 Dec 2003
Posts: 28
Location: Bucharest, Romania

PostPosted: Fri Aug 05, 2005 6:40 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group