例: GetAttachment method

  1. 次のスクリプトは、文書の添付ファイル JIM.SAM を取得します。
    Dim doc As NotesDocument
    Dim object As NotesEmbeddedObject
    '...set value of doc...
    Set object = doc.GetAttachment( "jim.sam" )
  2. 次のスクリプトは、文書の Body アイテムに添付ファイル JILL.SAM があるかどうかを調べます。アイテムに添付ファイルがないとき、スクリプトは GetAttachment を使用して文書全体を対象に添付ファイルを検索します。
    Dim doc As NotesDocument
    Dim rtitem As Variant
    Dim object As NotesEmbeddedObject
    '...set value of doc...
    Set rtitem = doc.GetFirstItem( "Body" )
    If ( rtitem.Type = RICHTEXT ) Then
      ' check for attachment in Body item
      Set object = rtitem.GetEmbeddedObject( "jill.sam" )
      If ( object Is Nothing ) Then
        ' check for attachment in rest of document
        Set object = doc.GetAttachment( "jill.sam" )
      End If
    End If