Hello forum,
I would like to set parameters by macro for outline numbering.
If I inspect a document with MRI, I found NumberingRules property.
But this interface is in read only.
How can I proceed?
[Solved] Writer: modify outline numbering parameters
[Solved] Writer: modify outline numbering parameters
Last edited by Mr.Dandy on Fri Aug 17, 2018 2:53 pm, edited 1 time in total.
OpenOffice 4.1.12 - Windows 10
Re: Writer: modify outline numbering parameters
NumberingLevel, NumberingRules etc set at the paragraph level.
https://www.openoffice.org/api/docs/com ... rties.html
https://www.openoffice.org/api/docs/com ... rties.html
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Writer: modify outline numbering parameters
Thanks for the clue.
But I don't see some parameters in ParagraphProperties. For example, how can I reach Separator's fields to have "Lesson" and "Study notes"?
But I don't see some parameters in ParagraphProperties. For example, how can I reach Separator's fields to have "Lesson" and "Study notes"?
OpenOffice 4.1.12 - Windows 10
Re: Writer: modify outline numbering parameters
LibreOffice 6.3 on Xubuntu 18.04
-
- Volunteer
- Posts: 1548
- Joined: Wed Jun 24, 2015 12:56 am
- Location: Colorado, USA
Re: Writer: modify outline numbering parameters
Based on the code I found in Listing 7.64 of Andrew Pitonyak's document "Useful Macro Information", the following appears to work.
Code: Select all
Sub CheckOutLine()
Dim i%, j%
Dim oRules
Dim oRule()
Dim oProp
oRules = ThisComponent.getChapterNumberingRules()
For i = 0 To oRules.getCount() - 1
oRule() = oRules.getByIndex(i)
REM I do not set the following:
REM Adjust, LeftMargin,
REM SymbolTextDistance, FirstLineOffset
For j = LBound(oRule()) To Ubound(oRule())
REM oProp is only a copy of the property.
REM You must assign the property back into the array.
oProp = oRule(j)
Select Case oProp.Name
Case "HeadingStyleName"
'oProp.Value = sNames(i)
Case "NumberingType"
'oProp.Value = com.sun.star.style.NumberingType.ARABIC
Case "ParentNumbering"
'oProp.Value = i + 1
Case "Prefix"
oProp.Value = "Lesson"
Case "Suffix"
oProp.Value = "Study Notes"
Case "StartWith"
oProp.Value = 8
End Select
oRule(j) = oProp
Next
oRules.replaceByIndex(i, oRule())
Next
End Sub
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Re: Writer: modify outline numbering parameters
Thanks UnklDonald (and so Sir Pitonyak)
OpenOffice 4.1.12 - Windows 10