How to: Store Data in a StorageItem for a Solution
|Outlook Developer Reference|
This topic describes how to store private application data in solution storage provided by the Outlook object model.
- Determine the folder where you would like to store your application data.
Note Because solution storage is created as hidden items in a folder, you can only store solution data if the store provider supports hidden items and the client has rights to write to that folder.
- Use Folder.GetStorage to obtain either an existing StorageItem object or a new StorageItem object if one does not already exist.
- Use StorageItem.Size to determine if the StorageItem is new. If it is, then use the Add method of StorageItem.UserProperties to create a custom property Order Number.
- Set the Order Number property. This assumes that an existing StorageItem already has the custom property Order Number defined.
- Use StorageItem.Save to save the StorageItem object as a hidden item in the folder.