Dear Support,
I was able to find something in Aspose forum close to what I want, but the code was Load From File.
Is there a way to Pass Outlook.MailItem to MAPIMessage ?
or
Is there a way to Convert Outlook.MailItem to Aspose.Network.Mail.MailMessage?
But my input is Outlook.MailItem mi
? // Aspose.Network.Mail.MailMessage m = (Aspose.Network.Mail.MailMessage) mi;
MapiMessage msg = MapiMessage.FromMailMessage(m, OutlookMessageFormat.Unicode);
Thanks.
Regards Dat.
public string get_propertytag_from_file(string msgfilename, string tagname)
{
string tagvalue = string.Empty;
// Load MSG file
MapiMessage msg = MapiMessage.FromFile(msgfilename);
MapiPropertyCollection properties = msg.NamedProperties;
// Read all properties inforeach loop
foreach (MapiNamedProperty mapiNamedProp in properties.Values)
{
if (mapiNamedProp.NameId == tagname)
{
tagvalue = mapiNamedProp.Tag.ToString();
break;
}
}
return tagvalue;
}