Password Protection
Posted: Tue Dec 18, 2007 4:08 am
Hi, I am new here. I have started using OO recently. I have used the macro recording to record the following macro and added the password statement (highlighted in red) , but it doesn't work!
Can anyone please help me? Millions thanks!
rem ----------------------------------------------------------------------
dim args5(4) as new com.sun.star.beans.PropertyValue
args5(0).Name = "Protection.Locked"
args5(0).Value = true
args5(1).Name = "Protection.FormulasHidden"
args5(1).Value = false
args5(2).Name = "Protection.Hidden"
args5(2).Value = false
args5(3).Name = "Protection.HiddenInPrintout"
args5(3).Value = false
args5(4).Name = "Password"
args5(4).Value = "1234"
dispatcher.executeDispatch(document, ".uno:Protection", "", 0, args5())
Can anyone please help me? Millions thanks!
rem ----------------------------------------------------------------------
dim args5(4) as new com.sun.star.beans.PropertyValue
args5(0).Name = "Protection.Locked"
args5(0).Value = true
args5(1).Name = "Protection.FormulasHidden"
args5(1).Value = false
args5(2).Name = "Protection.Hidden"
args5(2).Value = false
args5(3).Name = "Protection.HiddenInPrintout"
args5(3).Value = false
args5(4).Name = "Password"
args5(4).Value = "1234"
dispatcher.executeDispatch(document, ".uno:Protection", "", 0, args5())