如何将自定义属性添加到Outlook MailItem的InternetHeaders

时间:2019-06-15 16:03:42

标签: outlook vsto outlook-redemption

我需要从VSTO加载项向Outlook收件箱(在Exchange帐户中)的现有MailItem中添加自定义InternetHeader x-auth-guid。这里描述的东西 https://docs.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2010/dd633654(v=exchg.80) 但没有EWS。 使用EWS的代码可以正常工作,例如:

Application::setup()

但是在加载项中,两个PropertyAccessor都一样:

long sum = 0;
var options = new ParallelOptions()
    { MaxDegreeOfParallelism = Environment.ProcessorCount };
Parallel.ForEach(Partitioner.Create(0, arr.Length), options, range =>
{
    long localSum = 0;
    for (int i = range.Item1; i < range.Item2; i++)
    {
        localSum += arr[i];
    }
    Interlocked.Add(ref sum, localSum);
});

和兑换

extendedFieldURI.propertyName = "x-auth-guid"
extendedFieldURI.distinguishedPropertySetId = "InternetHeaders"
property.extendedFieldURI = extendedFieldURI
property.value = xauthGuid
message.addExtendedProperty(property)

似乎不起作用。我想念什么吗?

0 个答案:

没有答案