I’m looking for macro code to toggle sidebars open and closed.
I generally work with the navigator open on the left, and the style sidebar on the right. However, sometimes I want to close both to see the document larger, and then later open both up. I find the control/grab area on the sidebars too small to easily use, so closing and opening sidebars is a bit of a hassle. Not really difficult, but it takes a little while.
I’d like to use a macro to toggle the sidebars open and closed (both at once). However, recording the action in a macro doesn’t actually record anything. Does anyone know the macro commands I could use for this? Either to toggle the sidebars or to check their status and then open/close them as needed?
F5 toggles the Navigator, but I want to toggle both sidebars at once. I found this code for the navigator, but nothing yet for the other sidebar.
sub Navigator_on
dim document as object
dim dispatcher as object
dim args1(0) as new com.sun.star.beans.PropertyValue
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
args1(0).Name = "Navigator"
args1(0).Value = true
dispatcher.executeDispatch(document, ".uno:Navigator", "", 0, args1())
end sub
sub Navigator_off
dim document as object
dim dispatcher as object
dim args1(0) as new com.sun.star.beans.PropertyValue
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
args1(0).Name = "Navigator"
args1(0).Value = false
dispatcher.executeDispatch(document, ".uno:Navigator", "", 0, args1())
end sub
[From Apache OpenOffice Community Forum - [Solved] Macro to turn on the document navigator - (View topic)]