Adds an Attachment object to the collection.
This method creates a new Attachment object for the file and adds the object to the end of the collection. You can retrieve items from the collection using the Item method.
VBScript
attachments.Add filename, description
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