vba - Outlook 自动转发将回复设置为原始发件人而不是转发者

标签 vba outlook

我有 VBA 代码可将电子邮件转发到特定帐户。它有效,除非转发的电子邮件具有转发者的电子邮件地址。

邮件转发后如何保留原来的发件人邮箱地址作为回复?

Sub AutoForwardAllSentItems(Item As Outlook.MailItem)
    Dim strMsg As String
    Dim autoFwd  As Outlook.MailItem

    Set autoFwd = Item.Forward

    autoFwd.Recipients.Add "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fe9387a19b939f9792be9a91939f9790d09d9193" rel="noreferrer noopener nofollow">[email protected]</a>"

    autoFwd.Send

    Set autoFwd = Nothing
End Sub

最佳答案

so there is no way? really? – Mike 7 hours ago

Riking 提到 Outlook 不允许您修改电子邮件中包含的 header ,这是正确的。我猜测他指的是 .SenderEmailAddress 属性。您无法修改 .SenderEmailAddress,因为此属性是只读的。

话虽如此,您可能还想使用另一个属性。 .SentOnBehalfOfName此处有更多详细信息

主题:SentOnBehalfOfName 属性

链接:http://msdn.microsoft.com/en-us/library/aa171998%28v=office.11%29.aspx

引用上述链接

Returns a String indicating the display name for the intended sender of the mail message. This property corresponds to the MAPI property PR_SENT_REPRESENTING_NAME. Read/write.

expression.SentOnBehalfOfName

expression Required. An expression that returns a MailItem object.

另请参阅此链接

主题:自动设置新 Outlook 邮件的“发件人”地址

链接:http://benchristian.wordpress.com/2005/12/18/automatically-setting-the-from-address-of-a-new-outlook-message/

引用上述链接

Setting an alternate reply address is particularly useful if you are using a mail enabled public folder or distribution list for a group of users and would like the replies to messages that they send to go to the group smtp address instead of the sender’s mailbox.

HTH

关于vba - Outlook 自动转发将回复设置为原始发件人而不是转发者,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10528075/

相关文章:

vba - Outlook 2010宏引发VBA错误 'For loop not initialized'

HTML 电子邮件 <hr/> 样式问题

HTML 电子邮件 - Outlook.com/Hotmail 从 img 标签中剥离所有内联样式

excel - 如何为所有对象(MSForm 控件)分配相同的属性?

ms-access - Access 登录代码出现问题

python - 当我使用 Mime 从 Python 发送时,Outlook 和 Thunderbird 收不到附件

css - MS Outlook 2010 标题混合

csv 文件中的 Excel 尾随逗号错误

javascript - 从 VBA 调用 JavaScript

vba - 如何删除隐藏的引号