且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

答复(通过.Send)电子邮件Outlook“运行脚本"规则未触发传入消息的VBA脚本

更新时间:2023-02-03 21:14:55

成功了!我遵循了@ 0m3r技巧,并且我在网络上进行了一些研究以尝试解决此问题.

It worked! I followed @0m3r tips, and also I did some research on web to try to fix this issue.

我做了什么:

现在,我的宏是Sub Reply_Email(ByVal Email As Object),我只命名了Dim olReply As mailItemSet olReply = Email.ReplyAll.

Now, my macro is Sub Reply_Email(ByVal Email As Object) I named only Dim olReply As mailItem and Set olReply = Email.ReplyAll.

我看到的主要区别是这部分:

And the main difference that I saw was this part:

With olReply
    'Envia o e-mail
    .Send
End With

因此,添加此内容后,电子邮件已发送.该宏由Call Reply_Email(Email)调用.

So after added this, the e-mail was send. The macro is called by Call Reply_Email(Email).

最后,我添加了一条规则,如果主题中有"ENC:""RES:"字样,则不会回复电子邮件,这意味着如果收件箱中有某些回复电子邮件,什么都不会做.

And finally, I added a rule that will not reply the e-mail if there is the word "ENC:" or "RES:" in the subject, it means that if there is some reply e-mail in the inbox, it will do nothing.