Ouai Michael, je confirme...
Je suis en train de m'amuser avec NotesRichTextNavigator class
-> Ci dessous, un petit bout de code rigolot (amélioré depuis tout a l'heure ) A placer dans un HotSpot Bouton par exemple
-> Dans un 1er temps ça parcours un champ texte riche, renvois toutes les infos possibles (Nb d'objets, de paragraphes, de link...etc)
-> Ensuite, pour chaque docLink trouvé il affichera (la bb cible, l'id de réplique, le nom de la base... etc)
--------------------------------------------------------
Sub Click(Source As Button)
Dim session As NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim rti As NotesRichTextItem
Dim rtnav As NotesRichTextNavigator
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim rtrange As NotesRichTextRange
Dim rtlink As NotesRichTextDocLink
Dim workspace As New NotesUIWorkspace
Set session = New NotesSession
Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument
Set doc=uidoc.Document
Set rti = doc.GetFirstItem("Body")
Set rtnav = rti.CreateNavigator
'Affiche les informations générales pour ce champ (nb d'objets, de tableaux, paragraphe liens.....)
Messagebox "Alors, dans ce champ RT (" & rti.Name &") nous trouvons : "_
& Chr(13) & Chr(13) & Chr(13) &"Number of doc links = " & GetCount(rtnav, RTELEM_TYPE_DOCLINK) _
& Chr(13) & _
"Number of file attachments = " & GetCount(rtnav, RTELEM_TYPE_FILEATTACHMENT) _
& Chr(13) & _
"Number of OLE objects = " & GetCount(rtnav, RTELEM_TYPE_OLE) _
& Chr(13) & _
"Number of sections = " & GetCount(rtnav, RTELEM_TYPE_SECTION) _
& Chr(13) & _
"Number of tables = " & GetCount(rtnav, RTELEM_TYPE_TABLE) _
& Chr(13) & _
"Number of table cells = " & GetCount(rtnav, RTELEM_TYPE_TABLECELL) _
& Chr(13) & _
"Number of text paragraphs = " & GetCount(rtnav, RTELEM_TYPE_TEXTPARAGRAPH) _
& Chr(13) & _
"Number of text runs = " & GetCount(rtnav, RTELEM_TYPE_TEXTRUN),, _
"Elements in Body item"
Set rtnav = rti.CreateNavigator
If rtnav.FindFirstElement(RTELEM_TYPE_DOCLINK) Then
Set rtrange = rti.CreateRange()
count% = 0
'Affiche les infos (Db, view, Id, replique......) de tous les DocLink du document
Do
Set rtlink = rtnav.GetElement
count% = count% + 1
msg$ = rtlink.DisplayComment & Chr(13) & 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$ & Chr(13) & " - Serveur : " &rtlink.ServerHint ,, "Infos pour le DocLink N°"& count%
Loop While rtnav.FindNextElement( RTELEM_TYPE_DOCLINK)
End If
End Sub
-----------------------------------------------------------------
Function GetCount( rtnav As NotesRichTextNavigator, elementType As Integer) As Integer
GetCount = 0
If rtnav.FindFirstElement(elementType) Then
Do
GetCount = GetCount + 1
Print GetCount
Loop While rtnav.FindNextElement(elementType)
End If
End Function
------------------------------------------------------------------------
J'sais pas si ça pourra servir a qqun en tout cas j'me suis bien amusé avec ces classes 