Sending OLE Objects

MAPI supports embedding one document inside another, a concept known as OLE in Windows parlance. The document to be embedded in the message must have been previously saved as an OLE docfile (see sidebar). To attach it to a message, specify the parameters to the Attachment collection’s Add method as follows:

  1. Set the Type parameter to CdoOle.

  2. Set the Source parameter to the full path and filename of the docfile.

  3. Set the Position parameter to the character position within the message text at which the receiving mail client should render the object.

  4. Set the Name parameter to an empty string, or omit it from the parameter list.

Get CDO & MAPI Programming with Visual Basic: now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.