Change of the properties of paragraphs' numeration in Writer

Creating a macro - Writing a Script - Using the API

Change of the properties of paragraphs' numeration in Writer

Postby vadval15 » Mon Mar 08, 2021 2:36 pm

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
vadval15
 
Posts: 4
Joined: Mon Mar 08, 2021 2:22 pm

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

Postby JeJe » Mon Mar 08, 2021 4:14 pm

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?
Openoffice 4.1.6
Windows 8
JeJe
Volunteer
 
Posts: 1650
Joined: Wed Mar 09, 2016 2:40 pm

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

Postby vadval15 » Tue Mar 09, 2021 12:28 am

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
vadval15
 
Posts: 4
Joined: Mon Mar 08, 2021 2:22 pm

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

Postby JeJe » Tue Mar 09, 2021 10:45 am

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.
Openoffice 4.1.6
Windows 8
JeJe
Volunteer
 
Posts: 1650
Joined: Wed Mar 09, 2016 2:40 pm

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

Postby vadval15 » Fri Mar 12, 2021 1:40 am

List.jpg
List.jpg (15.95 KiB) Viewed 2382 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
vadval15
 
Posts: 4
Joined: Mon Mar 08, 2021 2:22 pm

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

Postby JeJe » Fri Mar 12, 2021 2:33 am

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.
Openoffice 4.1.6
Windows 8
JeJe
Volunteer
 
Posts: 1650
Joined: Wed Mar 09, 2016 2:40 pm

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

Postby vadval15 » Sun Mar 14, 2021 11:24 am

Thank you for your help. I think that your solution is the most appropriate.
OpenOffice 2.4 on Linux
vadval15
 
Posts: 4
Joined: Mon Mar 08, 2021 2:22 pm


Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 4 guests