Add

설명

Attachment 오브젝트를 콜렉션에 추가합니다.

참고: 이 메소드는 Visual Basic에만 해당합니다.

이 메소드는 파일의 새 Attachment 오브젝트를 작성한 후 오브젝트를 콜렉션에 끝에 추가합니다. Item 메소드를 사용하여 콜렉션에서 항목을 검색할 수 있습니다.

구문

VBScript

attachments.Add filename, description 
ID
설명
attachments
레코드의 한 필드에 있는 첨부 세트를 나타내는 Attachments 콜렉션 오브젝트.
filename
이 필드에 추가할 파일의 절대 또는 상대적 경로 이름을 포함하는 문자열.
description
첨부된 파일의 특징에 대해 기술하는 임의의 텍스트를 포함하는 문자열.
Return value
파일이 추가된 경우에는 True, 그렇지 않은 경우에는 False를 리턴하는 부울.

예제

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 

피드백