I want to convert all page styles to my own "Beige_Default", which I have imported into the document.
Currently I have pieced together the following macro. In the past it has worked occasionally, which I don't understand because it's not working presently.
Code: Select all
sub Page_styles_convert1
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Template"
args1(0).Value = "Beige_Default"
args1(1).Name = "Family"
args1(1).Value = 8
For i = 0 To 276
dispatcher.executeDispatch(document, ".uno:StyleApply", "", 0, args1())
dispatcher.executeDispatch(document, ".uno:GoToNextPage", "", 0, Array())
Next
end sub
I'm on LO 7.6.4.1
Thanks