PC Review


Reply
Thread Tools Rate Thread

CreateItemFromTemplate() losing Attachments

 
 
xadeqd
Guest
Posts: n/a
 
      1st Feb 2010
This is very, very rare, but the Attachments collection is returning empty
for some '.msg' files that I am loading with CreateItemFromTemplate(). I have
a small set of emails from 2002 where it happens every time, but I do not
know why it happens with them. When I open the MSG with Outlook 2007 the
attachments are there and can be opened, and OutlookSpy also reports that the
Attachments collection is not empty.

Sample of code where this happens (C#):

using Outlook = Microsoft.Office.Interop.Outlook;
....
Outlook._Application outlookApp = new Outlook.ApplicationClass();
Outlook._MailItem mailItem =
(Outlook._MailItem)outlookApp.CreateItemFromTemplate(@"path to certain msg
with attachments", Type.Missing);
int count = mailItem.Attachments.Count; //Collection empty, count is 0

I spot-checked other properties such as subject, body, from/to, and
everything looks good except for the attachments. Subsequently using SaveAs()
to re-save the MSG to disk yields the original MSG without any attachments.

Any advice is appreciated, crossing my fingers for anything that may lead me
to a workaround.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Losing attachments thothead Microsoft Outlook Discussion 1 7th May 2008 01:27 AM
Losing attachments =?Utf-8?B?TW9uaWNh?= Microsoft Outlook Discussion 8 29th Jul 2005 07:49 PM
losing attachments GMW Microsoft Outlook 1 12th May 2004 12:28 AM
losing Attachments sent 30leo Microsoft Outlook 5 15th Jan 2004 10:47 PM
losing email attachments Phil Windows XP Help 2 24th Oct 2003 03:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:44 AM.