Dim session As New NotesSession
Dim doc As NotesDocument ' главный документ на сервере
Set doc = .........
Dim rti As NotesRichTextItem ' поле BugReferences для временного хранения ссылок
Set rti = doc.GetFirstItem(BR)
If rti Is Nothing Then
Messagebox "Document contains no links",, "No links"
uidoc.FieldClear(BR)
Call uidoc.Refresh()
Exit Sub
End If
Dim rtnav As NotesRichTextNavigator
Set rtnav = rti.CreateNavigator
Dim rtlink As NotesRichTextDocLink
Set rtlink = rtnav.GetFirstElement(RTELEM_TYPE_DOCLINK)
While Not(rtlink Is Nothing )
If rtlink.DocUNID = String$(32, "0") Then
Messagebox "Link does not have a doc component",, "No doc"
Exit Sub
End If
Dim dblink As New NotesDatabase("", "") 'база данных документа на который указывает ссылка
If Not dblink.OpenByReplicaID(session.CurrentDatabase.Server, rtlink.DbReplicaID) Then
Messagebox "No local replica",, "Cannot find database"
Exit Sub
End If
Dim linkDoc As NotesDocument ' документ на который указывает ссылка
Set linkDoc = dblink.GetDocumentByUNID(rtlink.DocUNID)
If linkDoc Is Nothing Then
Messagebox "Can not find AFER",, "No doc"
Exit Sub
End If
.................
Set rtlink = rtnav.GetNextElement(RTELEM_TYPE_DOCLINK)
Wend