Attachment 오브젝트를 콜렉션에 추가합니다.
이 메소드는 파일의 새 Attachment 오브젝트를 작성한 후 오브젝트를 콜렉션에 끝에 추가합니다. Item 메소드를 사용하여 콜렉션에서 항목을 검색할 수 있습니다.
Perl
$attachments->AddAttachment(filename, description);
Perl
# This example assumes that there is at least
# one attachment field associated with the record
# For this entity record, get the collection of all
# attachment fields
$attachfields = $entity->GetAttachmentFields();
# Work with the first attachment field
$attachfield1 = $attachfields->Item(0);
# For this attachment field, get the collection of all
# its attachments
$theAttachments = $attachfield1->GetAttachments();
# Add the designated file and description to the
# attachments field
if (!$theAttachments->AddAttachment("c:\\attach1.txt","attachment description"))
{
$session->OutputDebugString("Error adding attachment to record.\n");
}