VSTO:缓存交换模式 VS LastModificationTime
我正在开发一个 VSTO Outlook 加载项,它依赖于 Outlook 约会的 LastModificationTime 属性。问题是当缓存交换模式打开时,每次关闭 Outlook 时 LastModificationTime 属性都会自动更新。是否有可能的解决方案可以用来获取用户更改约会时的日期和时间,而不是缓存交换模式更改约会时的日期和时间?
看到没有很多回复,我想更详细地描述我的问题 - 这就是发生的情况:
- 我更改了一个项目(异常行为仅发生在我更改的项目上)
- LastModificationTime 更改为我的时间已保存该项目(我使用 OutlookSpy 看到了更改)。 (例如,LastModificationTime 3:30:00 PM)
- 我工作到下午 4:00:00 PM 并检查 LastModificationTime,它仍然显示 3:30:00 PM
- 我关闭 Outlook
- 我打开 Outlook 并检查 LastModificationTime。现在,LastModificationTime 显示 3:30:42,而不是 3:30:00。 为什么我重新打开 Outlook 后又多了 42 秒?
感谢您给我的任何建议。
I am developing a VSTO Outlook Add-In that is relying on the LastModificationTime property of Outlook Appointment. The problem is when Cached exchange mode is turned On, the LastModificationTime property auto updates each time I close Outlook. Is there possible solution I can use to get the date and time when user changed the appointment, instead of date and time when cached exchange mode changed the appointment?
Seeing that there are not a lot of responses I wanted to describe my problem in more detail - this is what happens:
- I change an item (the abnormal behavior happens only to items I've changed)
- LastModificationTime is changed to the time when I've saved the item (I see the change with OutlookSpy). (eg. LastModificationTime 3:30:00 PM)
- I work until 4:00:00 PM and check the LastModificationTime and it still shows 3:30:00 PM
- I close outlook
- I open outlook and check LastModificationTime. Now the LastModificationTime shows 3:30:42 instead of 3:30:00.
Why did it add extra 42 seconds after I had reopened the Outlook?
Thank you for any suggestions you can give me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决问题的两种解决方法,#1 对我来说不可接受,#2 我实际使用过:
解决方案 #1:使用注册表项在加载项关闭时禁用 Exchange 服务器,并在加载项启动时重新启用它。下面是示例代码:
解决方案 #2:检测用户何时更改约会项目并将更改保存在用户定义的属性字段中。以下是示例代码:
谢谢大家的帮助
I was able to find two workarounds for my problem, #1 being unacceptable for me and #2 I actually used:
Solution #1: Use registry entries to disable exchange server on add-in shutdown and re-enable it on add-in startup. Below is sample code:
Solution #2: Detect when user changes an appointment item and save the change in user defined property field. Below is sample code:
Thank You everybody that helped