[Solved] Changing Page Style in Calc
Posted: Fri Apr 16, 2021 1:39 pm
Hi
I made a macro that creates a new page style called "Paakirja". The problem is that I can not put the style on to the sheet which also called "Paakirja":
...
Doc2.Sheets.insertNewByName("Paakirja", 0)
oSheets = Doc2.getSheets()
oObj1 = oSheets.getByName("Paakirja")
dim args1(1) as new com.sun.star.beans.PropertyValue
Dim dispatcher1 as Object
dispatcher1 = createUnoService("com.sun.star.frame.DispatchHelper")
args1(0).Name = "Template"
args1(0).Value = "Paakirja"
args1(1).Name = "Family"
args1(1).Value = 8
dispatcher1.executeDispatch(oObj1, ".uno:StyleApply", "", 0, args1())
Any help?
Regards Jue
I made a macro that creates a new page style called "Paakirja". The problem is that I can not put the style on to the sheet which also called "Paakirja":
...
Doc2.Sheets.insertNewByName("Paakirja", 0)
oSheets = Doc2.getSheets()
oObj1 = oSheets.getByName("Paakirja")
dim args1(1) as new com.sun.star.beans.PropertyValue
Dim dispatcher1 as Object
dispatcher1 = createUnoService("com.sun.star.frame.DispatchHelper")
args1(0).Name = "Template"
args1(0).Value = "Paakirja"
args1(1).Name = "Family"
args1(1).Value = 8
dispatcher1.executeDispatch(oObj1, ".uno:StyleApply", "", 0, args1())
Any help?
Regards Jue