1

Тема: Разбор поля RichTextltem по абзацам (NotesRichTextltem)

Задача - получить доступ к каждому абзацу  ричтекст поля "СОДЕРЖАНИЕ_" в текущем документе.
Получаем абзацы в rtRange.TextParagraph.

Sub Click(Source As Button)
    Dim session As New NotesSession
    Dim workspace As New NotesUIWorkspace
    Dim uidoc As NotesUIDocument
    Set uidoc = workspace.CurrentDocument
    Dim doc As NotesDocument
    Set doc = uidoc.Document
    Dim rtitem As NotesRichTextItem 
    Set rtitem = doc.GetFirstItem (  "СОДЕРЖАНИЕ_") 'создаем RTF-поле
    Dim rtnav As NotesRichTextNavigator
    Set rtnav = rtitem.CreateNavigator
    Dim rtRange As NotesRichTextRange
    Set rtRange = rtitem.CreateRange
    
    flag = rtnav.FindFirstElement( RTELEM_TYPE_TEXTPARAGRAPH )
    Do While flag
        Call rtRange.SetBegin (rtnav)
        flag =  rtnav.FindNextElement(RTELEM_TYPE_TEXTPARAGRAPH)    
        Call rtRange.SetEnd (rtnav)
        Messagebox rtRange.TextParagraph
    Loop
End Sub

Поделиться