I am trying to use Outlook object in windows service to read mails from a inbox and then extracting embedded images. But mail can have any type of images embedded in it. Is there any easy method in outlook API where i can save all the embedded in GIF Format?
if (newEmail.Attachments.Count > 0)
{
for (int i = 1; i <= newEmail
.Attachments.Count; i++)
{
string value = newEmail.Attachments[i].PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3712001E");
if (!String.IsNullOrEmpty(value))
{
newEmail.Attachments[i].SaveAsFile
(@"C:\TestFileSave\" +
newEmail.Attachments[i].FileName);
}
}
}