自动删除电子邮件正文中的警告 [英] Automatically Remove Warning in Email Body

查看:537
本文介绍了自动删除电子邮件正文中的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的Corporate Exchange管理员决定通过在每封传入的外部电子邮件的正文中添加一个红色粗体警告来保护用户免受网上诱骗,以防万一可能是网上诱骗尝试. BC我的电子邮件的大部分是外部的,这已经令人讨厌.我也经常需要在转发或回复电子邮件之前手动删除警告(以免惊吓那些不太精明的收件人).我们的企业管理员对我的困境并不同情.因此,我正在寻找一种在邮件到达时或在我回复/转发电子邮件时自动删除警告的方法.我曾经玩过VB,但对编写适当的代码还不够了解.任何帮助将不胜感激!在Windows 10上使用OL 2016并在消息正文中显示警告(不是主题行)

Our Corporate Exchange admin decided to protect users from phishing by adding a bold red warning in the body of every incoming external email, just in case it might be a phishing attempt. bc MOST of my email is external, this has become obnoxious. I also very often need to manually remove the warning before forwarding or replying email (so as to not alarm the less-savvy recipient). Our corporate admin is not sympathetic to my plight. So, I am looking for a way to automate removing the warning, when email arrive or alternatively when I reply/forward the email. I have played with VB a bit but don’t know enough to write the appropriate code. Any help would be greatly thanked! Using OL 2016 on Windows 10 and warning is in body of message (not subject line)

不幸的是,OL不允许像其他Office应用程序一样进行宏录制.因此,我看了一些有帮助的教程,但讲解不足以带来成功.我想出了这段代码,但在突出显示了Dim语句的情况下得到了编译错误:Sub或Function中的无效属性":

Unfortunately OL does not allow macro recording like other office applications. So, I looked at some tutorials that helped but did not explain enough to bring success. I came up with this code but get "Compile error: Invalid attribute in Sub or Function" with the Dim statement highlighted:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim WithEvents myOLMail As Outlook.MailItem Replace(myOLMail, "Caution - External Email", "") As String End Sub

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim WithEvents myOLMail As Outlook.MailItem Replace(myOLMail, "Caution - External Email", "") As String End Sub

很明显,我需要更基本的了解.我通读了在Outlook中使用VBA入门2010 ,但还需要更多.任何帮助或资源都会很棒.我一直想学习VB.

It is obvious I need more basic understanding. I read through Getting Started with VBA in Outlook 2010 but need more. Any help or resources would be awesome. I have been wanting to learn VB for some time.

推荐答案

在ThisOutlookSession模块中.

In the ThisOutlookSession module.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

     Item.HTMLBody = Replace(Item.HTMLBody, "Caution - External Email", "")

End Sub

使用应用程序"时不需要Dim语句.这比Microsoft文档中描述的方法更简单.如果需要,它将在模块顶部的Sub之外.

The Dim statement is not needed when using "Application". This is simpler than the way described in Microsoft documentation. If you needed it, it would be outside of the Sub at the top of the module.

这篇关于自动删除电子邮件正文中的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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