私たちは顧客のアドレス帳からOutlookを使用して情報をエクスポートしました。 ここで、Exchangeを使用してその情報を維持および更新したいと考えています。Exchange Webservices(EWS)を使用して連絡先のPostOfficeBoxにアクセスするにはどうすればよいですか?
この目的でExchange Webservices APIを使用することにしました。
私は連絡先を取得し、それらの連絡先の中に仕事、家庭およびその他のアドレスが含まれているPhysicalAddresses列挙であることができます。
これらのアドレスは、PhysicalAddressEntryクラスのインスタンスです。
このクラスは、ストリートアドレス、郵便番号、市、州および地域/国が含まれています。 (参照:https://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.physicaladdressentry_members(v=exchg.80).aspx)
をそれはしかし、Outlookのアドレス項目が持っているPostOfficeBoxフィールドが含まれていません:
- BusinessAddressPostOfficeBox
- HomeAddressPostOfficeBox
- MailingAddressPostOfficeBox
- OtherAddressPostOfficeBox
(参照してください。 :https://msdn.microsoft.com/en-us/vba/outlook-vba/articles/contactitem-object-outlook)
Exchange Webservices APIには、PhysicalAddressEntryクラス(詳細:https://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.personapostaladdress_properties(v=exchg.80).aspx参照)より詳細なPersonaPostalAddressクラスがあります。それにはPostOfficeBoxのメンバーがいます。私は私の連絡先のうち、PersonaPostalAddressエントリを得ることに成功していない
(参照: https://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.contact_properties(v=exchg.80).aspx)を特定のアドレスに属しPostOfficeBoxフィールドを読み、多分書くための方法はありますか?
は、我々はすでに拡張プロパティとして読んでいる「ユーザー定義された」プロパティがあり、それらはPublicStrings名前空間にあります。 (参照:)
PublicStrings、Address、Commonとして "OtherAddressPostOfficeBox"という拡張プロパティを作成しようとしましたが、返されませんでした。
はopenedge /進行コードを許すが、ここで私が試したものです:
DEFINE VARIABLE continent-regio AS CLASS Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition NO-UNDO.
DEFINE VARIABLE OtherAddressPostOfficeBox AS CLASS Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition NO-UNDO.
DEFINE VARIABLE properties AS CLASS "Microsoft.Exchange.WebServices.Data.PropertyDefinitionBase[]" NO-UNDO.
ASSIGN continent-regio = NEW Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition(Microsoft.Exchange.WebServices.Data.DefaultExtendedPropertySet:PublicStrings,"Continent/Regio",Microsoft.Exchange.WebServices.Data.MapiPropertyType:String).
ASSIGN OtherAddressPostOfficeBox = NEW Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition(Microsoft.Exchange.WebServices.Data.DefaultExtendedPropertySet:Common,"OtherAddressPostOfficeBox",Microsoft.Exchange.WebServices.Data.MapiPropertyType:String).
ASSIGN properties = NEW "Microsoft.Exchange.WebServices.Data.PropertyDefinitionBase[]"(3).
properties:SetValue(continent-regio,0).
properties:SetValue(Microsoft.Exchange.WebServices.Data.ContactSchema:PostalAddressIndex,1).
properties:SetValue(OtherAddressPostOfficeBox,2).
contactlijst:PropertySet = NEW Microsoft.Exchange.WebServices.Data.PropertySet(
Microsoft.Exchange.WebServices.Data.BasePropertySet:FirstClassProperties,
properties).
DELETE OBJECT properties.
ASSIGN contacten = service:FindItems(Microsoft.Exchange.WebServices.Data.WellKnownFolderName:Contacts, contactlijst).
DO iX = 0 TO contacten:Items:COUNT - 1:
IF STRING(contacten:Items:Item[iX]:GetType()) EQ "Microsoft.Exchange.WebServices.Data.Contact" THEN DO: /* Mailinglijsten overslaan */
ASSIGN contactpersoon = CAST(contacten:Items:Item[iX], Microsoft.Exchange.WebServices.Data.Contact).
DO iY = 0 TO contactpersoon:ExtendedProperties:COUNT - 1:
CASE contactpersoon:ExtendedProperties:ITEM[iY]:PropertyDefinition:NAME:
WHEN continent-regio:NAME THEN ASSIGN tt-cp.continent-regio = contactpersoon:ExtendedProperties:ITEM[iY]:VALUE.
WHEN OtherAddressPostOfficeBox:NAME THEN MESSAGE contactpersoon:ExtendedProperties:ITEM[iY]:VALUE
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END CASE.
END.
DELETE OBJECT contactpersoon.
END.
END.
我々はPostOfficeBoxフィールドカスタムContinent/Regio
フィールドをこのように読むことはできませんが。
ExtendedPropertyDefinitionクラス(参照:https://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.extendedpropertydefinition_members(v=exchg.80).aspx)の他のコンストラクタの1つを使用するには、これらのフィールドの数値IDが必要なのでしょうが、見つけられないようです。
私は0x3A64(14948)はOtherAddressPostOfficeBoxためのIDであるかもしれないが、それはどちらか動作しませんでしたことを発見した後、これを試してみました。
ASSIGN OtherAddressPostOfficeBox = NEW Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition(Microsoft.Exchange.WebServices.Data.DefaultExtendedPropertySet:Address,14948,Microsoft.Exchange.WebServices.Data.MapiPropertyType:String).
私は正しいプロパティ識別子を使用しましたか?このように動作するのでしょうか、まったく違うことをする必要がありますか?
編集:フィールドの名前を使用可能なすべてのフィールドに入力したExchangeコンタクトアイテムのこれらのアドレスフィールドに対してブルートフォース攻撃を実行しています。ほとんどの場合、Exchangeは内部サーバーエラーで応答しますが、32768以降、フィールドは定期的に表示されます。
ID 0x804A/32842がBusinessAddressPostOfficeBoxに対応していることを確認できますので、他の人がポップアップするとすぐに回答が追加されることを期待してください。 PersonaPostalAddressをサーバから直接取得する方法を知っていれば、気軽にコメントしてください。
我々は唯一BusinessAddressPostOfficeBoxはアドレスDefaultExtendedPropertySetの外に取り出すことができる場であるとして私が思ったほど簡単ではなかったのMicrosoft Exchange Server 2010 SP3(14.3.123.4002)