VBA for Outlook和一般对象焦点问题 [英] VBA for Outlook and General Object Focus Question

查看:250
本文介绍了VBA for Outlook和一般对象焦点问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天,b
我有一个功能性的VBA脚本(Outlook 2010与Exchange 2013),它将读取电子邮件,收集正文中的文本并将文本值保存为所需的CSV文件。


如果我设置触发此VBA的Outlook规则,则会忽略读取所需文本的电子邮件的脚本 - 移动调用邮件到垃圾箱文件夹工作(最后一行是VBA脚本)。

如果我在Outlook客户端中打开规则管理器并手动运行规则,则完整的VBA脚本将根据需要运行。



我在这里缺少什么?我怀疑,与手动运行规则相比,触发规则时这是一个重点。无论哪种情况,Outlook客户端都会打开,等待处理电子邮件。



非常简化但核心示例: 

- 再次如果手动运行,我会做'做某事,但如果由规则触发,它会跳过并执行item.delete。



Sub CreateNewUserData(item as Outlook.MailItem)

解决方案

嗨bflagg,


谢谢你访问我们的论坛。


然后,我们主要关注有关Outlook客户端的一般问题。由于您的查询与开发涉及Outlook的问题更相关,因此我将您的主题移至以下专用于Outlook的MSDN论坛:


https://social.msdn.microsoft.com/Forums/en-US/home?forum=outlookdev


我们建议适当发布的原因是您将获得最合格的受访者群体,而定期阅读论坛的其他合作伙伴可以分享他们的知识或从您与我们的互动中学习。感谢您的理解。


最好的问候,

Yuki Sun


Good day,
I do have a functional VBA script (outlook 2010 with Exchange 2013) that will read a email, gather text within the body and saves the text values as a desired CSV file.

If I set an outlook rule that triggers this VBA, the script that reads the email for the desired text is ignored - the call to move the mail to trash folder works (the last line is the VBA script).
If I open Rules Manager in the outlook client and manually run the rule, the full VBA script runs as desired.

What is my missing focus here? I suspect it is a focus thing when a rule is triggered as compared to running it manually. Either case the outlook client is opened waiting for the email to be processed.

Very simplified but core example: 
- again if run manually, I get to 'do something, but if triggered by a rule, it skips out and item.delete is carried out.

Sub CreateNewUserData(item as Outlook.MailItem)

解决方案

Hi bflagg,

Thanks for visiting our forum.

Then here we mainly focus on general questions about Outlook client. Since your query is more related to developing issues involving Outlook, I'll move your thread to the following dedicated MSDN forum for Outlook:

https://social.msdn.microsoft.com/Forums/en-US/home?forum=outlookdev

The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

Best regards,
Yuki Sun


这篇关于VBA for Outlook和一般对象焦点问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆