2

EWS Webサービスを使用してメールボックスで自動プロセスを実行し、ExtendedPropertyDefinition次のようなメッセージに割り当てています。

Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition extendedPropertyDefinition =
                           new Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition(DefaultExtendedPropertySet.Common, "Archivado", MapiPropertyType.String);

  msgComplete.SetExtendedProperty(extendedPropertyDefinition, iddoc);
                             msgComplete.Update(ConflictResolutionMode.AlwaysOverwrite);

一方、メッセージがクリックされるたびに評価する必要があるOutlookアドインを開発しています。そのメッセージにこのExtendedPropertyDefinition名前が定義されている場合、Outlookクラスを使用してOutlookアドインからExtendedプロパティを復元する方法がわかりません。

両方のフレームワークからアクセスできるようにするために別の種類のプロパティを使用する必要があるかどうかは気にしません。

Outlookで次のプロパティを使用してみましたが、うまくいきませんでした。

item.Userproperties;

item.PropertyAccesor.GetProperty("Archivado"); 

item.ItemProperties;
4

1 に答える 1

2

わかりました、ついに私はそれを手に入れました。Guidを使用してExtendedPropertyDefinitionを作成し、次のようなプロパティのスキーマを使用してOutlookから回復する必要がありました。

//Setting the property with Exchange webservice:

string guid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";

Guid MY_PROPERTY_SET_GUID = new Guid(guid); 

Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition extendedPropertyDefinition =
new Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition(MY_PROPERTY_SET_GUID, "Archivado", MapiPropertyType.String);


//Recover the property using Outlook:


Outlook.MailItem item = (Outlook.MailItem)e.OutlookItem;

Outlook.UserProperties mailUserProperties = item.UserProperties;

dynamic property=item.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/string/{Outlook.MailItem item = (Outlook.MailItem)e.OutlookItem;

            Outlook.UserProperties mailUserProperties = item.UserProperties;
            dynamic property=item.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/string/{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}/Archivado");
于 2013-03-01T08:30:31.700 に答える