如何在 Outlook 2007 加载项中高效运行后台任务?

发布于 2024-08-25 12:53:46 字数 279 浏览 5 评论 0原文

我希望有人能够为我指出正确的方向,即如何在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

生死何惧 2024-09-01 12:53:46

不建议在 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文