This topic describes how to delete existing solution data to reset the solution storage:
Use Folder.GetStorage to obtain an existing StorageItem object in a specific folder. This call will return a new StorageItem object if none already exists.
Use StorageItem.Delete to remove the object permanently from the folder.
Use Folder.GetStorage to create a new instance of the StorageItem object with the same subject.
Use StorageItem.Save to save the StorageItem object to the folder.
Sub StoreData()
Dim oInbox As Folder
Dim myStorage As StorageItem
Dim myPrivateProperty As UserProperty
Set oInbox = Application.Session.GetDefaultFolder(olFolderInbox)
' Get an existing instance of StorageItem by subject
Set myStorage = oInbox.GetStorage("My Private Storage", olIdentifyBySubject)
'Remove the storage permanently assuming it's old
myStorage.Delete
Set myStorage = Nothing
'Get a new instance of StorageItem in the Inbox
Set myStorage = oInbox.GetStorage("My Private Storage", olIdentifyBySubject)
'Create custom property for Order Number
Set myPrivateProperty = myStorage.UserProperties.Add("Order Number", olNumber)
'Store application data in the Order Number property
myPrivateProperty.Value = 1000
'Save the data to the Inbox
myStorage.Save