我正在Outlook 2007中开发实用程序
我可以为特定的mailItem添加User属性
<i>
myMailItem.UserProperties.Add("ParentMailRecipients", Outlook.OlUserPropertyType.olText,true, Outlook.OlUserPropertyType.olText);
myMailItem.UserProperties["ParentMailRecipients"].Value = SavedMailItem.To + ";" + SavedMailItem.CC;
myMailItem.Save();
</i>
Run Code Online (Sandbox Code Playgroud)
一段时间后,我需要删除特定的用户属性.
User Property具有删除用户属性的方法(Remove(int))
我不知道如何找到特定用户属性的索引并删除它.请帮我找到解决方案?
您可以使用属性名称从UserProperties集合中搜索UserProperty,并在拥有UserProperty对象后,在其上调用Delete方法.
UserProperty up = myMailItem.UserProperties["ParentMailRecipients"];
if(up != null)
up.Delete();
Run Code Online (Sandbox Code Playgroud)