【发布时间】:2021-09-23 10:19:57
【问题描述】:
我已运行以下代码来添加类型为 olText 的特定 UserProperty:
mailItem.UserProperties.Add(Name: "MyProperty", Type: OlUserPropertyType.olText);
我决定改用整数作为类型,并将代码更改为:
mailItem.UserProperties.Add(Name: "MyProperty", Type: OlUserPropertyType.olInteger);
然而,这给了我一个COMException,说明属性名称已经存在,但类型不同。我什至不知道关闭我的应用程序后用户属性会持续存在。现在我似乎无法摆脱它!
我已按照建议的here 进行了尝试,但是当我尝试使用mailItem.UserProperties["MyProperty"] 检索UserProperty 时,我得到了null。
我怎样才能完全摆脱我添加的用户属性?我怎么看他们?
【问题讨论】: