开发者

In Outlook 2007 using VSTO 3.0, how to detect if the default store has changed since Outlook was started?

开发者 https://www.devze.com 2022-12-28 22:16 出处:网络
I\'m doing something similar to this, but wondering if there is an event somewhere that I\'m missing Store DefaultStore

I'm doing something similar to this, but wondering if there is an event somewhere that I'm missing

Store DefaultStore
    {
        get
        {
            var defaultStore = mOutlookApp_Model.Session.DefaultStore;

            if ( defaultStore.StoreID == mDefaultStore.StoreID )
            {
                // the default store we set at startup is the same as the default store now, so all good
                return mDefaultStore;
            }
            else
            {
                // the user changed the default store, so restart the addin_app
                DefaultStoreChangedRest开发者_C百科artAddIn.Fire();
                return null;
            }
        }
    }
    readonly Store mDefaultStore; 


Nope there isn't anything like this in the API, so hand crafting something is the only way.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号