Sending File Attachments
Sending a file as an attachment is easy. To add attachments to an outgoing message:
Set the AttachmentIndex property of the MAPIMessages control appropriately (0 for the first attachment, 1 for the second attachment, etc.).
Set the AttachmentPathName property to the fully qualified path of the file you would like to send. This is the path of the file as it exists on the sending system. This path is not communicated to the receiving mail client.
Set the AttachmentName property to a short name for the file. This is typically the filename and extension of the file, but it can be any string. The receiving mail client uses this string to name the file on the receiving system, so setting it to a reasonable filename and extension, such as
"MyResume.doc", is helpful.Set the AttachmentType property to
mapData, which indicates that the attached file is a data file (as opposed to an embedded OLE object, to be discussed shortly).Set the AttachmentPosition property to indicate at which character position the attachment should appear. Some mail clients display a representation of the file within the body of the message at the character position indicated by AttachmentPosition. (However, some ignore this value and display the attachments separately.)
Note the following in regard to the AttachmentPosition property:
This property is zero-based, meaning that the first character in the message is at position 0, and the last character in the message is at
Len(MAPIMessages1.MsgNoteText) ...