Ask Your Question
0

Insert formatted text with a macro

asked 2021-04-19 00:48:19 +0200

Olivier gravatar image

Having the history of the question

https://ask.libreoffice.org/en/questi...

The relevant lines are

    labelString = oCurs.ListLabelString
    oCurs.getText().insertString(oCurs, labelString & " ", False)

I'd like to insert labelString as a formatted string with char style ZZZ.

In HTML-ish, that would be equivalent to

 <p><span class="ZZZ">'content of labelString'</span> ... </p>
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2021-04-20 16:18:55 +0200

Olivier gravatar image

Placing at the start of the paragraph:

     oCurs.gotoStartOfParagraph(false)
     oCurs.CharStyleName = "Strong Emphasis"
     labelString = oPar.ListLabelString & " "
     oCurs.getText().insertString(oCurs, labelString , False)
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2021-04-19 00:48:19 +0200

Seen: 22 times

Last updated: Apr 20