Platform SDK: CDO 1.2.1 |
The ReadFromFile method loads the contents of an attachment from a file.
objAttach.ReadFromFile(fileName)
The ReadFromFile method replaces the existing contents of the Attachment object, if any.
The ReadFromFile method operates differently, depending on the value of the Attachment object's Type property. The following table describes its operation:
Attachment Type property | ReadFromFile operation |
---|---|
CdoFileData | Copies the contents of the specified file to the attachment. |
CdoEmbeddedMessage | (Not supported) |
Note The current version of the CDO for NTS Library does not support ReadFromFile for CdoEmbeddedMessage attachments. These calls generate the run-time error CdoE_NO_SUPPORT.
You can load the contents of an attachment when you first create it by specifying the type and source parameters when you call the Add method of the Attachments collection.