Otlook VBA和规则以转发电子邮件并更改主题 [英] Otlook vba and rule to forward email message and change subject
问题描述
我有一个脚本规则,几乎可以正常工作. 我想将一些特定的传入电子邮件转发到具有规则的电子邮件地址,但我也想稍作更改.
I have a rule with script and almost works fine.. I would like to forward some specific incoming emails to an email address with rule but I also would like to change the subject a bit as well.
我有一段正常运行的代码:
I have this code which works fine:
Sub ForwardEmail(Item As Outlook.MailItem)
Set myForward = Item.Forward
myForward.Subject = ("ITS - ") & Item.Subject
myForward.Recipients.Add "backup@email.com"
myForward.Send
End Sub
我的问题是,激活此规则后,转发的电子邮件将获得我的签名,并且还会收到前一封电子邮件中的发件人:已发送:收件人:主题:"行.有什么办法可以在转发邮件之前将其删除?
My problem is when this rule activated the forwarded emails will get my signature and also the "from: Sent: To: Subject:" lines from the previous email. Is there any way to remove them before forwarding the message?
也许我可以根据收到的电子邮件以新电子邮件的形式发送邮件吗?我的电子邮件的正文中包含图片(而非附件),因此可能会引起我的问题.
Maybe if I send as a new email based on the incoming one can that work? My email includes a picture in the body (not attachment) so that can cause problem in my case.
推荐答案
您可能想尝试一下:
Sub ForwardEmail(Item As Outlook.MailItem)
With Item.Forward
.Subject = ("ITS - ") & Item.Subject
.Recipients.Add "backup@email.com"
' You need to overwrite the Body or HTMLBody to get rid of the auto signature
.HTMLBody = Item.HTMLBody ' <-- Or use .Body for Plain Text
'.Display ' <-- For Debug
.Send ' <-- Put break here to Debug
End With
End Sub
这篇关于Otlook VBA和规则以转发电子邮件并更改主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!