Read only mode

Creating a macro - Writing a Script - Using the API

Read only mode

Postby antonz » Mon Jul 28, 2008 8:33 am

Good afternoon
There is a problem to block the document (to translate in a mode only reading) by means of macros (i.e. duplicate work of property of the menu service-parameters-security-set password). Somebody can faced a similar problem or even knows from what it is necessary to begin?
OOo 2.3.X on Ms Windows XP
antonz
 
Posts: 1
Joined: Mon Jul 28, 2008 8:27 am

Re: Read only mode

Postby pdjota » Mon Aug 04, 2008 9:22 pm

Hello, I have the same problem, I'd like to catch the opening event of a Document and if it complies with certain constraints open iot in read-only mode.
Did you solve your problem?
TIA
OOo 2.3.X on Ms Windows XP + Linux
pdjota
 
Posts: 4
Joined: Tue Jul 15, 2008 9:30 pm

Re: Read only mode

Postby pdjota » Mon Aug 04, 2008 10:11 pm

Hi again, I finded a post in the old forum which solves the problem with OOBasic, now I'm figuring out how to translate it into Java.
Code: Select all   Expand viewCollapse view
Sub SetReadOnly
   dim url as string
   dim document as object
   dim dispatcher as object
   
   document=thisComponent
   url=document.getUrl
   
   GlobalScope.BasicLibraries.LoadLibrary("Tools")
   
   if getAttr(url)<>1 then   
      dispatcher=createUnoService("com.sun.star.frame.DispatchHelper")
      setattr(url,1) //readonly mode.
      dispatcher.executeDispatch(thisComponent.CurrentController.Frame,".uno:Reload","",0,array())
   end if
End Sub


http://www.oooforum.org/forum/viewtopic.phtml?t=65973
OOo 2.3.X on Ms Windows XP + Linux
pdjota
 
Posts: 4
Joined: Tue Jul 15, 2008 9:30 pm


Return to Macros and UNO API

Who is online

Users browsing this forum: Google [Bot] and 8 guests