이는 읽기 전용 특성입니다. 즉, 볼 수는 있으나 설정할 수는 없습니다. 그러나 Attachments 오브젝트의 메소드를 사용하여 콜렉션에 항목을 추가(또는 콜렉션에서 제거)할 수 있습니다.
필드에 연관된 첨부 파일이 없더라도 이 특성은 항상 Attachments 오브젝트를 리턴합니다. 필드에 연관된 파일이 없으면 Attachments 오브젝트의 Count 메소드에 값 0이 포함됩니다.
VBScript
attachmentField.Attachments
Perl
$attachmentField->GetAttachments();
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 For each attachment in theAttachments 'Do something with each attachment Next
Perl
# This example assumes that there is at least 1 attachment # field associated with the record. Otherwise, # GetAttachmentFields won't return anything interesting and an # error would be generated # Get the collection of attachment fields $attachfields = $entity->GetAttachmentFields(); # Get the first attachment field $attachfield1 = $attachfields->Item(0) # Now get the collection of attachments from the attachments field $attachments = $attachfield1->GetAttachments(); # Retrieve the number of attachments for the for loop $numattachments = $attachments->Count(); for ($x = 0 ; $x < $numattachments ; $x++) { $attachment = $attachments->Item($x); # ...do some work with $attachment }