The following two scripts demonstrate the differences between accessing objects using the EmbeddedObjects property in NotesDocument and NotesRichTextItem. Both scripts access the last document in the All Documents view of HILL.NSF on the server SanFrancisco.
The document contains the following:
1. This script uses the EmbeddedObjects property in NotesDocument, and displays the following:
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Set db = New NotesDatabase( "SanFrancisco", "hill.nsf" )
Set view = db.GetView( "All Documents" )
Set doc = view.GetLastDocument
Forall o In doc.EmbeddedObjects
Messagebox( o.Name )
End Forall
2. This script uses the EmbeddedObjects property in NotesRichTextItem, and displays the following:
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument
Dim rtitem As Variant
Set db = New NotesDatabase( "SanFrancisco", "hill.nsf" )
Set view = db.GetView( "All documents" )
Set doc = view.GetLastDocument
Set rtitem = doc.GetFirstItem( "Body" )
If ( rtitem.Type = RICHTEXT ) Then
Forall o In rtitem.EmbeddedObjects
Messagebox( o.Name )
End Forall
End If