PR_SEARCH_KEY using EWS

痞子三分冷 提交于 2019-12-02 12:14:19

Its a Binary property so what you will get back is a Binary Array if you want to get the same Hex String as in the OOM just use something ilke

        ExtendedPropertyDefinition eDef = new ExtendedPropertyDefinition(0x300B, MapiPropertyType.Binary);
        PropertySet prop = BasePropertySet.IdOnly;
        prop.Add(eDef);
        ItemView ivItemView = new ItemView(1000);
        ivItemView.PropertySet = prop;
        FindItemsResults<Item> fiResults = Inbox.FindItems(ivItemView);
        foreach (Item itItem in fiResults) {
            Byte[] PropVal;
            String HexSearchKey;
            if (itItem.TryGetProperty(eDef, out PropVal)) {
                HexSearchKey = BitConverter.ToString(PropVal).Replace("-", "");
                Console.WriteLine(HexSearchKey);
            }

        }

Cheers Glen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!