Change of the properties of paragraphs' numeration in Writer

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
vadval15
Posts: 4
Joined: Mon Mar 08, 2021 2:22 pm

Change of the properties of paragraphs' numeration in Writer

Post by vadval15 »

How can I place a text cursor to the numbers of the numbered paragraphs of a text document to change their properties using a macro? Thank you in advance for your reply.
OpenOffice 2.4 on Linux
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Change of the properties of paragraphs' numeration in Wr

Post by JeJe »

Not sure what you mean...

Do you mean the nth Outline Numbered paragraph?
Or do you want to go to the nth paragraph of the document?
Or do you want to set the text cursor to a paragraph while enumerating the paragraphs?

Edit:
Or do you mean the actual numbering of the Outline Numbered paragraphs?
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
vadval15
Posts: 4
Joined: Mon Mar 08, 2021 2:22 pm

Re: Change of the properties of paragraphs' numeration in Wr

Post by vadval15 »

Thank you for the answer. The ways I know how to navigate a text document include only paragraphs, but do not cover their numbering. To change the properties of these numbers (color in particular), I need to position the text cursor at the beginning of the range, and then select the fragment to be changed. How to do this using Basic, I do not know.
OpenOffice 2.4 on Linux
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Change of the properties of paragraphs' numeration in Wr

Post by JeJe »

Still not following - you could provide a screenshot or attach a document with your question.

Do you mean the numbering that is set with Format Menu/Paragraph/Outline & Numbering tab/Numbering style?

The numbering style has a character style and you change the character style to change the color of the numbering.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
vadval15
Posts: 4
Joined: Mon Mar 08, 2021 2:22 pm

Re: Change of the properties of paragraphs' numeration in Wr

Post by vadval15 »

List.jpg
List.jpg (15.95 KiB) Viewed 9983 times
Yes, you are right, this is exactly the numbering I mean. Ultimately, I should end up with paragraph numbers of different colors. The problem is that the command gotoStartOfParagraph moves the text cursor after the paragraph number, to its first letter. Which command can put the text cursor on the paragraph number, I don't know.
OpenOffice 2.4 on Linux
JeJe
Volunteer
Posts: 2764
Joined: Wed Mar 09, 2016 2:40 pm

Re: Change of the properties of paragraphs' numeration in Wr

Post by JeJe »

You can't put the text cursor on the paragraph number - it doesn't work like that, its not available to you.

It looks that you can achieve what you want by setting the paragraph style to one which has the font color set to the one you want the paragraph number to be and then changing the color of the rest of the paragraph's text to black with format/character/font color.

You need a character such as a space at the start of the text which remains the same color as the paragraph number though.

Awkward... maybe someone else has another way.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
vadval15
Posts: 4
Joined: Mon Mar 08, 2021 2:22 pm

Re: Change of the properties of paragraphs' numeration in Wr

Post by vadval15 »

Thank you for your help. I think that your solution is the most appropriate.
OpenOffice 2.4 on Linux
Post Reply