I have a document saved with a rich text field. I am trying to use the rich text navigator to pick up and retain the formatted text for display on the web, via an agent.
Here is the code which I took from the help and modified for my own use:
Dim dc As NotesDocumentCollection
Dim body As NotesRichTextItem
Dim rtnav As NotesRichTextNavigator
Set session = New NotesSession
Set db = session.CurrentDatabase
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
Set body = doc.GetFirstItem(“Details”)
Set rtnav = body.CreateNavigator
REM Get count of text paragraphs
count% = GetElementCount(rtnav, RTELEM_TYPE_TEXTPARAGRAPH)
msg$ = msg$ & “Text paragraphs:” & Chr(9) & count% & Chr(10)
REM Get count of text runs
count% = GetElementCount(rtnav, RTELEM_TYPE_TEXTRUN)
msg$ = msg$ & “Text runs:” & Chr(9) & Chr(9) & count% & Chr(10)
REM Display counts
Print msg$
Function GetElementCount(rtnav As NotesRichTextNavigator, eType As Integer) As Integer
GetElementCount = 0
If rtnav.FindFirstElement(eType) Then
Do
GetElementCount = GetElementCount + 1
Loop While rtnav.FindNextElement()
End If
End Function
The result indicate that there is nothing stored, when I know that there is:
Text paragraphs: 0 Text runs: 0
Is there something I am doing wrong? I am trying to break this task into pieces so I can better understand how it all works.
Any suggestions or ideas would be greatly appreciated. Thanks in advance.