I’m starting to play with NotesRichTextRange, NotesRichTextNavigator, and the like to slice and dice rich text fields. Briefly put, what I’m doing is to work through the message to find the last web link and truncate everything after that, which is likely to include a doclink. I’m doing OK with some messages which have been generated by LotusScript, but it’s a different story when I try it on messages generated by @formulas. If I use FindLastElement(RTELEM_TYPE_TEXTPARAGRAPH) on those messages, the NotesRichTextRange ends up encompassing the entire body. It looks like RTELEM_TYPE_TEXTPARAGRAPH respects new lines created by NotesRichTextItem.AddNewline(), but not by @NewLine. Can anyone confirm this, or am I doing something wrong? And if I’m right, why is this? Is there a work-around?
Subject: What determines RTELEM_TYPE_TEXTPARAGRAPH?
No, you’re not doing anything wrong. A rich text paragraph may contain carriage returns. To use an analogy, it’s rather like HTML, where paragraphs are marked off by
tags, but you can throw ainto the middle of one if you want to.
Subject: What determines RTELEM_TYPE_TEXTPARAGRAPH?
If anybody’s interested in a workaround, here’s what I came up with: messages created with LotusScript and messages which have been edited in the client don’t need help. For messages created with @formulas, using @Char(10) + @Char(13) instead of @NewLine seems to create paragraph breaks which RTELEM_TYPE_TEXTPARAGRAPH will detect.