问题
I am developing my first add-in for the Outlook Web App. It's not clear to me where I should store larger pieces of data provided by the user (e.g., big chunks of text, images) and to be associated with the add-in (as opposed to belonging to a particular mail item).
My impression is that RoamingSettings is supposed to be for relatively small stuff, and therefore not a good fit. I could store the data on OneDrive, but I prefer not to expose the data to the user outside of the add-in UI. I found this SO entry but the answer seems to be more applicable to desktop Outlook, not OWA. I suppose I could store the data on my own server if I need to, but I first I want to know if there's already something in the OWA architecture that would serve this purpose.
回答1:
RoamingSettings is the default choice for storing application/user settings/data, but there is a 32K limit that can be used per setting and 2MB total for all settings used by your add-in. An alternative approach is to use EWS to create a message in a hidden folder and store your data in the message body.
I created an implementation that serializes XML into the hidden message and back into JavaScript objects. You can see my article here (with sample app and source code in GitHub) on how to do it:
https://blogs.msdn.microsoft.com/mvpawardprogram/2016/01/26/unifying-your-web-dev-skills-for-office-add-ins/
回答2:
I am a developer for Microsoft working on Outlook addins.
You should store the larger data with your service / on your server as you noted. A message is generally not suited for storing random data for your addin. Using makeEwsRequestAsync requires a ReadWriteMailbox for addin permission that may not be necessary otherwise.
Another note is that the 32K limit is the limit for RoamingSettings per addin for Outlook. It's not 2MB.
来源:https://stackoverflow.com/questions/37536439/where-to-store-larger-data-for-outlook-web-app