使用VBA从电子邮件中删除签名 [英] Delete Signature from email with VBA

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

问题描述

我目前正在使用vba为项目匿名化电子邮件.

I am currently in the process of anonymizing emails with vba for a project.

当前,当接收到电子邮件时,我创建了一个规则,将电子邮件移动到文件夹中,此后,我使用getlast函数在该特定文件夹中运行脚本,在其中显示新接收到的电子邮件并复制邮件的内容.电子邮件,然后将其粘贴到新电子邮件中并发送到特定的电子邮件地址.这有效地删除了电子邮件的识别功能.

Currently when an email is received I have created a rule which moves the email into a folder, thereafter I run a script using the getlast function, in that specific folder, where I display the newly received email and copy the content of the email and then i paste this into a new email and send to a particular email address. This effectively removes the identifying features of the email.

Rubik's Cube的最后一步是找到电子邮件签名并替换为空白,换句话说,删除签名.我将拥有电子邮件签名来执行此操作,但是如果有人可以为此提供帮助,那就太好了.

The final movement to the Rubik's Cube is to find the email signature and replace with blank, in other words delete the signature. I will have the email signatures to do this, however it would be great if someone someone could help with this...

推荐答案

我找到了这个解决方案.

I found this solution.

'I also had to add Word in tools/references of VBA and then Call DeleteSig(msg) after displaying the item.
'http://www.access-programmers.co.uk/forums/showthread.php?t=259417

Sub DeleteSig(msg As Outlook.MailItem)
    Dim objDoc As Word.Document
    Dim objBkm As Word.Bookmark
    On Error Resume Next
    Set objDoc = msg.GetInspector.WordEditor
    Set objBkm = objDoc.Bookmarks("_MailAutoSig")
    If Not objBkm Is Nothing Then
        objBkm.Select
        objDoc.Windows(1).Selection.Delete
    End If
    Set objDoc = Nothing
    Set objBkm = Nothing
End Sub

这篇关于使用VBA从电子邮件中删除签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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