I’m looking for a macro to toggle between Normal and Web views in Writer. I can do one or the other, but I can’t toggle them both using one macro.
Here’s typical code:
sub Normal_View
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "NormalViewMode" ' or: "PrintLayout"
args1(0).Value = false ' seems unnecessary
dispatcher.executeDispatch(document, ".uno:PrintLayout", "", 0, args1())
end sub
sub Web_View
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "BrowseView"
args1(0).Value = false
dispatcher.executeDispatch(document, ".uno:BrowseView", "", 0, args1())
end Sub
Thank you.