例: Type property (NotesEmbeddedObject - LotusScript®)

次のスクリプトは文書の Body アイテムにある埋め込みオブジェクト、オブジェクトリンク、添付ファイルの個数を数えて、その結果をステータスバーに表示します。例えば、スクリプトは「3 attachments 2 links 4 objects」のように表示します。

Dim doc As NotesDocument
Dim rtitem As Variant
Dim attachCount As Integer
Dim linkCount As Integer
Dim objectCount As Integer
'...set value of doc...
Set rtitem = doc.GetFirstItem( "Body" )
attachCount = 0
linkCount = 0
objectCount = 0
If ( rtitem.Type = RICHTEXT ) Then
  Forall o In rtitem.EmbeddedObjects
    Select Case o.Type
    Case EMBED_ATTACHMENT:
      attachCount = attachCount + 1
    Case EMBED_OBJECTLINK:
      linkCount = linkCount + 1
    Case EMBED_OBJECT:
      objectCount = objectCount + 1
    End Select
  End Forall
End If
Print( attachCount & " attachments " & linkCount & _
" links " & objectCount & " objects " )