I need to have a quick button to activate Format - Paragraph - Outline&List - Restart Numbering - Start at 1.
So I recorded a macro to activate the command and I got the following macro:
sub RestartNumber
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 = "NumberingStart"
args1(0).Value = true
dispatcher.executeDispatch(document, ".uno:NumberingStart", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "NumNewStartAt"
args2(0).Value = 1
dispatcher.executeDispatch(document, ".uno:NumNewStartAt", "", 0, args2())
end sub
All right. The problem is that the result is the number is set to 1 but the paragraph does not keep the Restart Numbering checkbox.
Question is: Besides a possible bug, what will be the right command sequence to the both NumberingStart and NumNewStartAt working together?
And if you ask me why a macro for restart numbering if you can have it in a context menu, the reason is that the context menu is binded to .uno:NumberingStart and has no provision to set the number to start at. Then you hit 149380 – For first item in numbered list of a document "Restart Numbering" only works, if start number checkbox in paragraph dialog is also selected
TIA
Olivier