I have a Outlook mailbox full of messages that have embedded objects. Using CDO, I'm trying to write some code that steps through the messages and saves all the embedded objects to disk.

Using the WriteToFile method, I'm able to save embedded XL spreadsheets and any format file that is an attachment, but when I try to save the embedded images like .bmp files (the largest percent of my embedded objects), they appear to be corrupt (wrong size and won't open in registered programs).

How do embedded object differ from attachments and how do I programmatically save these object to files.