自动删除电子邮件正文中的警告

编程入门 行业动态 更新时间:2024-10-20 11:54:50
本文介绍了自动删除电子邮件正文中的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们的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.

更多推荐

自动删除电子邮件正文中的警告

本文发布于:2023-10-12 23:56:56,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1486233.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文中   电子邮件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!