Why Outlook's RoamingSettings object initialized with old values after page re-load/ redirect?

梦想的初衷 提交于 2019-11-28 10:28:10

This is a known issue, and is in the backlog. We don't have an ETA to share at this time.

I've created a workaround for this issue. Here is a link to my blog post about it:

http://metrosharesolutions.com/blogs/office365development/roaming-settings-workaround/

Here is a link to my code:

https://github.com/joeparzel/RoamingFix

This workaround will somewhat disable the Custom Properties functionality but it solves the issue for those who are creating one-pagers. Here is an excerpt from the blog post:

In order to accomplish this workaround, we’ve added some extra (parsable) information to the Value that is saved with the Key – specifically we add a GUID and a date/time stamp. After appending this extra information to the value, we save the value to both Roaming Settings and Custom Properties. This is done because of the “reload” issue described in the Stack Overflow post referenced earlier. Finally, we don’t really remove values from the Roaming Settings / Custom Properties databases; rather we set the values to what our code thinks means “deleted.” To retrieve the correct value, the code will decipher which value (between Roaming Settings and Custom Properties) is correct based on the date/time stamp and return the GUID if the key has been deleted.

The code for this workaround is under the MIT license, so feel free to download and add it to your own production Outlook Add-in… after testing of course!

As per the documentation, the saved value can be retrieved on the next time the plugin is used, isn't there anyway to reload the plugin whenever we need to retrieve the value directly after saving. This can be an acceptable workaround I guess.

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