Basically, I have a db that has a richtext field. I would like to iterate thru the rtf in a manner that reads the item and then the next item, no matter what type I have indicated initially. Below is code I have written and it gets the first values; however, it fails to continue to iterate thru the rest of the elements. I have tried several ways of accomplishing this, but to no avail. I hope someone can help me…thanks…
Set session = New NotesSession
Set db = session.CurrentDatabase
Set dc = db.UnprocessedDocuments
If dc.Count = 0 Then
Messagebox "No document selected",, "No doc"
Exit Sub
End If
Set doc = dc.GetFirstDocument
Set body = doc.GetFirstItem("dbinfo")
Set rtnav = body.CreateNavigator
u% = rtnav.FindFirstElement(RTELEM_TYPE_TEXTPARAGRAPH)
If rtnav.FindFirstElement(RTELEM_TYPE_TEXTPARAGRAPH) Then
Set rtrange = body.CreateRange
Do
Call rtrange.SetBegin(rtnav)
Print rtrange.TextRun
If rtnav.FindNextElement(RTELEM_TYPE_FILEATTACHMENT) Then
Call rtrange.SetBegin(rtnav)
Forall o In body.EmbeddedObjects
Print o.Name
Exit Forall
End Forall
Print rtrange.Type
Call rtrange.SetEnd(rtnav)
u% = rtnav.FindNextElement(RTELEM_TYPE_TEXTPARAGRAPH)
End If
Loop While rtnav.FindNextElement(RTELEM_TYPE_TEXTPARAGRAPH)
End If