Skip to Content
CDO & MAPI Programming with Visual Basic:
book

CDO & MAPI Programming with Visual Basic:

by Dave Grundgeiger
October 2000
Intermediate to advanced
384 pages
10h 22m
English
O'Reilly Media, Inc.
Content preview from CDO & MAPI Programming with Visual Basic:

Reading File Attachments

When reading messages with attachments, the attachment-related properties are used in much the same way as they are when sending messages with attachments. The difference, of course, is that you’re reading the properties rather than setting them. Before reading the attachment-related properties, first set the MsgIndex property to indicate which message to read, then read the AttachmentCount property to determine if the message has any attachments. If it does (i.e., if AttachmentCount is greater than 0), set the AttachmentIndex property to refer to a specific attachment. The AttachmentIndex property is a zero-based index that can range from to one less than the value contained in the AttachmentCount property. See Section 4.3.1, earlier in this chapter, for a more detailed discussion of how these properties work.

After setting the AttachmentIndex property, you’re ready to read the attachment information. All attachments are saved by the mail system as files in a temporary folder, regardless of whether the attachment is actually a binary file or an embedded OLE object. This is because embedded OLE objects are saved as files prior to being sent. As discussed earlier in this chapter, working with embedded OLE objects using the MAPI controls is exceedingly laborious, so it won’t be discussed further here. For a little detail on how it works, see Section 4.6, earlier in this chapter. This section considers only file attachments.

The full pathname of an attached ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Excel® 2007 VBA Programmer's Reference

Excel® 2007 VBA Programmer's Reference

John Green, Stephen Bullen, Rob Bovey, Michael Alexander
COM Programming with Microsoft® .NET

COM Programming with Microsoft® .NET

John Paul Mueller, Julian Templeman

Publisher Resources

ISBN: 156592665XSupplemental ContentCatalog PageErrata