I have the following code in an agent. Most of it I copied directly from the R-6 documentation.
While Not thisDoc Is Nothing
If thisDoc.Form(0) = "note" Then
Set rti = thisDoc.GetFirstItem("Attachments")
If rti Is Nothing Then
If Msgbox("Could not get item attachment",MB_YESNO,"Problem") = IDNO Then
Exit Sub
Else
Goto goNext
End If
End If
Set rtnav = rti.CreateNavigator
If Not rtnav.GetFirstElement(RTELEM_TYPE_DOCLINK) Then
Msgbox "No doclinks in attachment", , "No doclinks"
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 'If the ViewUNID is 32 zeros, there is no view
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
Msgbox msg,, rtlink.DisplayComment
If Msgbox ("Continue?", MB_YESNO,"Question") = IDNO Then Exit Sub
Loop While rtnav.FindNextElement
End If
goNext:
Set thisDoc = thisView.GetNextDocument(thisDoc)
Wend
The agent fails every time with a type mismatch with the debug pointer located at the “If Not rtnav…” line. When I look at the variables in the debug window, rtnav is nothing. This is an R-5 database but I’m running the agent on an R-6 client (hence posting here). I recognize that the NotesRichTextNavigator class is new with R-6 but since it’s not an NSF element, this code should still work… right? P.S. I have %included lssconst.
Can anyone help?
Thanks.
Randy