Add

説明

コレクションに Attachment オブジェクトを追加します。

注: このメソッドは Visual Basic 専用です。

このメソッドは、ファイル用の新規 Attachment オブジェクトを作成して、コレクションの最後にオブジェクトを追加します。コレクションからアイテムを取得するには、Item メソッドを使用します。

構文

VBScript

attachments.Add filename, description 
識別子
説明
attachments
Attachments コレクション オブジェクト。レコードの 1 つのフィールドの添付ファイルのセットを表します。
filename
このフィールドに添付されるファイルの絶対または相対パス名を含む String。
description
添付ファイルの性質を説明する任意のテキストを含む String。
戻り値
ファイルが正常に追加された場合は True、そうでない場合は False の Boolean。

VBScript

' This example assumes there is at least 1 attachment field 
' associated with the record. 
set currentSession = GetSession
set attachFields = AttachmentFields
set attachField1 = attachFields.Item(0) 

set theAttachments = attachField1.Attachments 
If Not theAttachments.Add("c:¥attach1.txt", "Defect description") Then
  OutputDebugString "Error adding attachment to record." 
End If 

フィードバック