VSTO:隐藏联系人属性
我是 VSTO 的新手,正在开发 Outlook 的插件,该插件将允许最终用户跟踪联系人之间的关系。这些关系存储在单独的 SQL 数据库中,我将 SQL 数据行的 ID 放在附加到 Outlook 联系人的自定义属性中。不幸的是,如果用户查看“所有字段”窗格,则该 ID 在“此项的用户定义字段”下可见。有什么方法可以阻止用户看到(更重要的是编辑)这些属性吗?
I am new to VSTO, and am developing an addon to Outlook that will allow the end users to track relationships between contacts. The relationships are stored in a separate SQL database, and I put the ID of the SQL data row in a custom property attached to the Outlook contact. Unfortunately, if the user ever views the "All Fields" pane, this ID is visible under "User-defined fields for this item". Is there any way to prevent the user from being able to see (and more importantly edit) these properties?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为有任何方法可以将用户看不到的数据“附加”到 OL 联系人上。
另一方面,您的数据库中可以有一个字段来跟踪联系人 ID(我忘记了确切的字段名称,但我知道每个联系人都有一个与其关联的唯一键值),然后在获取数据时使用该字段在您的 SQL 数据库中。
这种方法的唯一问题是 Outlook 习惯于在您执行某些操作时重置 PK 值(例如将联系人从一个文件夹移动到另一个文件夹,Outlook 会将其视为删除/添加,因此联系人的 PK 会发生变化) )。
我似乎记得有一次使用了一种混合方法,既执行了这两项操作(将联系人的 PK 存储在 SQL 中,又将联系人的自定义字段存储在 SQL ID 中),然后保持它们同步。但据我回忆,那是有点痛苦。
或者,如果用户移动了联系人,您也可以将其视为删除/添加,并根据需要更新您的 SQL。
I don't believe there's any way to "attach" data to OL contacts that can't be seen by the user.
On the other hand, you could have a field in you DB that tracks the Contact ID (I forget the exact field name offhand, but I know each contact has a unique key value associated with it) and then use THAT when getting to the data in your SQL DB.
The only problem with that approach is that outlook has a habit of resetting that PK value when you do certain things (like move a contact from one folder to another, Outlook treats that as a DELETE/ADD, so the PK for the contact will change).
I seem to recall using a hybrid approach at one point that did BOTH (stored the PK of the contact in SQL and a custom field in the Contact stored a SQL ID) and then just keeping them synched. But as I recall, it was a bit of a pain.
alternately, if the user moved a contact, YOU could also treat it as a DELETE/ADD and update your SQL as applicable.