Hi,
I have one doc link in a richtext field. When I am exicuting the following code to remove that doc link, it is throwing an error,“Resrtcted operation cannot crossed logical boundries”.
Any idea how to overcome this.
codes written–>
%INCLUDE “lsconst.lss”
Dim session As NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim rti As NotesRichTextItem
Dim rtnav As NotesRichTextNavigator
Dim rtlink As NotesRichTextDocLink
Sub Initialize
Set session = New NotesSession
Set db = session.CurrentDatabase
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
Set rti = doc.GetFirstItem(“Body”)
Set rtnav = rti.CreateNavigator
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 Messagebox("Do you want to delete this doclink?", _
MB_YESNO + MB_ICONQUESTION, _
rtlink.DisplayComment) = IDYES Then
rtlink.Remove
End If
Loop While rtnav.FindNextElement
Call doc.Save(True, True)
End Sub
regards,
Saswat