If your main concern is to get at the attachments, you can use the Outlook object model's Namespace.CreateItemFromTemplate method to create a new item that's a copy of the .msg item.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"chris" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> Hi,
>
> I am have trouble opening an msg file that has attachments using CDO
>
> My attachments are not loading correctly in the object model and
> instead I get attachment added to the text body which is just a garbled
> mess.
>
> What I am trying to do is use CDO to open the msg file so I can look at
> the number of attachments it has, but as the attachment is not loaded
> into the attachments collection the count is not available to me. I am
> using the following code to load the file:
>
> Function LoadMessageFromFile(Path As String) As Message
> Dim Stm As New Stream
> Stm.Open
> Stm.LoadFromFile Path
> Dim iMsg As New CDO.Message
> Dim iDsrc As IDataSource
> Set iDsrc = iMsg
> iDsrc.OpenObject Stm, "_Stream"
> Set LoadMessageFromFile = iMsg
> End Function
>
> If anyone can help me I would appreciate it.
>
> TIA
>
> Chris
>