developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks




CreateNavigator returns nothing
Sheri A Reed 02/15/2013 12:14 PM
Applications Development All Releases All Platforms


Code is in an Action, shown below. The rti is a valid Body field, however RTNAV returns nothing. I've tried this in a couple apps with same result. I've seen this problem posted before in this forum, but can't get anything to work, including Andrei's close & re-open routine. Anybody?

Sub Click(Source As Button)
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim uidoc As NotesUIDocument
Set db = session.currentdatabase
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.document
Dim rti As NotesRichTextItem
Dim rtnav As NotesRichTextNavigator
Dim rtlink As NotesRichTextDocLink
Set session = New NotesSession

Set dc = db.UnprocessedDocuments

Set rti = doc.GetFirstItem("Body")

Set rtnav = rti.CreateNavigator <===rtnav blank

If Not rtnav.FindFirstElement(RTELEM_TYPE_DOCLINK) Then
Messagebox "No doclinks in Body item",, "No doclinks"
Exit Sub
End If
Do
Set rtlink = rtnav.GetElement
If rtlink.ServerHint = "" Then
server$ = "Local"
Else
server$ = rtlink.ServerHint
End If
msg$ = "Server = " & server$
msg$ = msg$ & Chr(13) & _
"Replica ID = " & rtlink.DbReplicaID
If rtlink.ViewUNID <> String$(32, "0") Then
msg$ = msg$ & Chr(13) & "View UNID = " & rtlink.ViewUNID
End If
If rtlink.DocUNID <> String$(32, "0") Then
msg$ = msg$ & Chr(13) & "Doc UNID = " & rtlink.DocUNID
End If
Messagebox msg$,, rtlink.DisplayComment
Loop While rtnav.FindNextElement
End Sub

Go back