Sunday, March 4, 2018

email - VBA / Outlook 2010 - Reply / Reply to All from Default Mail Address

with the below VBA code I was able to create a new button on the Outlook 2010 ribbon from which I can send emails with my default email address.



Now I want to have a similar button on the Outlook 2010 ribbon for "replying / replying all". Outlook selects, when "replying" or "replying all", by default the mail address as sender the mail came into but I would like to send all my emails with the default email address.



That's the VBA script I used to which I found in that tutorial here: 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


Any ideas how to change the above code or does anyone have an idea how I can create such buttons on the outlook ribbon for "replying" emails?



Thank you!

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...