【问题标题】:VBA / Outlook 2010 - Reply / Reply to All from Default Mail AddressVBA / Outlook 2010 - 从默认邮件地址回复/回复所有人
【发布时间】:2013-06-24 09:31:09
【问题描述】:

使用下面的 VBA 代码,我能够在 Outlook 2010 功能区上创建一个新按钮,我可以通过该按钮使用我的默认电子邮件地址发送电子邮件。

现在我想在 Outlook 2010 功能区上有一个类似的按钮,用于“回复/全部回复”。 Outlook 在“回复”或“全部回复”时选择默认邮件地址作为邮件的发件人,但我想使用默认电子邮件地址发送我的所有电子邮件。

这是我在该教程中找到的 VBA 脚本:http://www.sevenforums.com/tutorials/129318-outlook-2010-always-send-default-account.html

Public Sub New_Mail()
Dim oAccount As Outlook.Account
Dim oMail As Outlook.MailItem
For Each oAccount In Application.Session.Accounts
If oAccount = "Name of Default Account" Then
Set oMail = Application.CreateItem(olMailItem)
oMail.SendUsingAccount = oAccount
oMail.Display
End If
Next
End Sub

任何想法如何更改上述代码,或者是否有人知道如何在 Outlook 功能区上创建此类按钮以“回复”电子邮件?

谢谢!

【问题讨论】:

    标签: email vba button outlook reply


    【解决方案1】:

    我终于解决了!就是下面的代码:

    Public Sub Reply_Mail()
    Dim oAccount As Outlook.Account
    Dim oMail As Outlook.MailItem
    
    For Each oAccount In Application.Session.Accounts
    
    If oAccount = "Name of your mail address" Then
        Set oMail = Application.ActiveExplorer.Selection(1).Reply
          oMail.SendUsingAccount = oAccount
        oMail.Display
    End If
    Next
    
    End Sub
    

    【讨论】:

      猜你喜欢
      • 2017-10-09
      • 2015-10-27
      • 2012-03-04
      • 2021-03-12
      • 2012-02-24
      • 2016-10-16
      • 2014-10-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多