Is it possible to change paragraph style using the new R6 Rich Text LotusScript classes? I am trying to programmatically modify the alignment of rich text fields from “left” to “center”, and it seems that this is not possible, although it is very easy to change text style (font size, etc). Your help will be greatly appreciated.
Subject: RE: Can I change paragraph style of existing rich text?
The back-end classes, as you have noticed, don’t include a method for changing the paragraph style of existing text. I’ve tried to find a way to do this also, with no success.
If you can assume that the paragraph doesn’t contain any information that you can’t see using the rich text classes, such as images or URL links, then you can delete the text and reinsert it with a new style. This may get you an extra, undesired prargraph break, but you can go back and delete that.
Another choice is to export the document in DXL, change the DXL and re-import it.
Or, you can use the C/C++ Notes API or a 3rd-party tool based on that API, such as Midas Rich Text LSX from www.geniisoft.com.
Subject: RE: Re: REPOST: Is it possible to change paragraph style?
I have the workaround for Method is not available:
First, you “touch” all the paragraphs:
If rtnav.FindFirstElement (RTELEM_TYPE_TEXTPARAGRAPH) Then
Do
Call rtitem.BeginInsert (rtnav)
Call rtitem.AppendText ("")
Call rtitem.EndInsert
Loop While rtnav.FindNextElement (RTELEM_TYPE_TEXTPARAGRAPH)
End If
Now you can append the style:
If rtnav.FindFirstElement (RTELEM_TYPE_TEXTPARAGRAPH) Then
Do
Call rtitem.BeginInsert (rtnav)
Call rtitem.AppendParagraphStyle(rtpStyle)
Call rtitem.EndInsert
Loop While rtnav.FindNextElement (RTELEM_TYPE_TEXTPARAGRAPH)
End If
Either you need to re-create the rich text with the new style or look at something like our Midas Rich Text LSX (http://www.GeniiSoft.com) to change existing paragraph styles.