如何在 Outlook 2007 加载项中高效运行后台任务?
我希望有人能够为我指出正确的方向,即如何在 Outlook 2007 中运行后台任务,同时保持良好的用户体验。我有一个流程,循环遍历默认 Outlook 日历中的每个项目并将信息(主题、位置等)发送到后端服务器。我尝试过 ThreadPool.QueueUserWorkItem 并创建一个线程并将其 isBackground 设置为 true,但此任务运行时 Outlook 中正常操作的用户体验似乎受到影响。理想情况下,我希望此后台任务能够运行,并且 Outlook 不会显得缓慢。关于我如何实现这一目标有什么想法吗?
谢谢
I was hoping someone could point me in the right direction as far as how to run background task in Outlook 2007 while preserving a good User experience. I have a process that loops through each item in a default Outlook calendar and sends information (subject, location, etc.) to a back-end server. I have tried ThreadPool.QueueUserWorkItem and creating a Thread and setting it isBackground to true, but the User experience of normal operation in Outlook while this task is running seems to be compromised. Ideally I would like for this background task to run and not have Outlook seem sluggish. Any thoughts on how I could achieve this?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不建议在 out 中运行后台线程,可以这样做,但这取决于您在代码中实际执行的操作,OOM 在单线程单元 COM 服务器中运行,因此每个 COM 调用都在 Outlook 的主线程上执行.exe
根据您的描述,最好的选择是处理不使用 OOM 的项目。
如果您正在运行 Exchange(取决于版本),您可以使用 EWS 或 ExchangeDav。
否则MAPI。
马库斯
Running background threads in out are not recomended, it can be done but it depends on what you are actualy doing in your code, The OOM is run in a single threaded apartment COM server, so every COM call is executed on the main thread of outlook.exe
From you description the best bet would be to process the items not using the OOM.
If you are running Exchange (dependant on the version) you can use EWS or ExchangeDav.
Otherwise MAPI.
Marcus