[Solved] Editing Style Properties through VB Macro
Posted: Fri Feb 26, 2010 2:25 pm
Hi Friends! I'm a newbie to OOo Writer (using v3.2 on WinXP)
I tried everything to record a VB macro that might let me change a preset paragraph (or character) style:
I've got some text set in "myStyle" style which is set "black", I don't mean to change directly the text style or property, but I wish to change "myStyle"'s colour property to "red" through a macro (I'll link to a button; another button will link a similar Macro doing the contrary: a fast way to switch view)
Recording a Macro I get this code:
...
args1(0).Name = "Param"
args1(0).Value = "myStyle"
args1(1).Name = "Family"
args1(1).Value = 1
dispatcher.executeDispatch(document, ".uno:EditStyle", "", 0, args1())
...
but running it just allows me to open the Edit Style Dialog Window, it seems it cannot record any setting..
I guess I need to complete the code manually by mysef somehow:
May you help me to get a sample VB code to change properties of a named Style through a Macro?
Thanks anybody for your time,
Vittorio (Italy)
I tried everything to record a VB macro that might let me change a preset paragraph (or character) style:
I've got some text set in "myStyle" style which is set "black", I don't mean to change directly the text style or property, but I wish to change "myStyle"'s colour property to "red" through a macro (I'll link to a button; another button will link a similar Macro doing the contrary: a fast way to switch view)
Recording a Macro I get this code:
...
args1(0).Name = "Param"
args1(0).Value = "myStyle"
args1(1).Name = "Family"
args1(1).Value = 1
dispatcher.executeDispatch(document, ".uno:EditStyle", "", 0, args1())
...
but running it just allows me to open the Edit Style Dialog Window, it seems it cannot record any setting..
I guess I need to complete the code manually by mysef somehow:
May you help me to get a sample VB code to change properties of a named Style through a Macro?
Thanks anybody for your time,
Vittorio (Italy)