private static string GetNamedPropertyByAspose()
{
//ExStart:ReadingNamedMAPIPropertyFromAttachment
// The path to the File directory.
string dataDir = RunExamples.GetDataDir_Outlook();
// Load from file
MailMessage mail = MailMessage.Load(dataDir + "outputAttachments.msg");
var mapi = MapiMessage.FromMailMessage(mail);
foreach (MapiNamedProperty namedProperty in mapi.Attachments[0].NamedProperties.Values)
{
if (string.Compare(namedProperty.NameId, "CustomAttGuid", StringComparison.OrdinalIgnoreCase) == 0)
{
return namedProperty.GetString();
}
}
return string.Empty;
//ExEnd:ReadingNamedMAPIPropertyFromAttachment
}
}