Ref this article: http://www.slipstick.com/outlook/email/choose-the-account-to-send-a-reply-from/
First of all, I would like to say thank you for this to the person that wrote the article. It has helped me a lot, but also resulted in a problem I am hoping someone can help with. The email account is changing, but the signature does not change to the default one for the new account. Also, the email seems to be corrupted in a way since changing the account manually also now does not change the signature for this email. I am using Outlook 2007. Any ideas? Thanks much in advance! Here's my code in case it is helpful...
Public Sub New_Reply()
Dim objApp As Outlook.Application
Dim oAccount As Outlook.Account
Dim oMail As Outlook.MailItem
Set objApp = CreateObject("Outlook.Application")
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set oMail = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set oMail = objApp.ActiveInspector.CurrentItem
Case Else
End Select
Dim recip As Outlook.Recipient
Dim ae As Outlook.AddressEntry
Set recip = oMail.Recipients.Item(1)
Set ae = recip.AddressEntry
Dim sAddress As String
sAddress = ae.Address
Select Case sAddress
Case "support@domain1.com"
For Each oAccount In Application.Session.Accounts
If oAccount = "Support" Then GoTo EndCode
Next
Case "sales@domain1.com"
For Each oAccount In Application.Session.Accounts
If oAccount = "Sales" Then GoTo EndCode
Next
Case "info@domain2.com"
For Each oAccount In Application.Session.Accounts
If oAccount = "2nd Support" Then GoTo EndCode
Next
End Select
EndCode:
Set oMail = Application.ActiveExplorer.Selection(1).Reply
oMail.SendUsingAccount = oAccount
oMail.Display
End Sub
First of all, I would like to say thank you for this to the person that wrote the article. It has helped me a lot, but also resulted in a problem I am hoping someone can help with. The email account is changing, but the signature does not change to the default one for the new account. Also, the email seems to be corrupted in a way since changing the account manually also now does not change the signature for this email. I am using Outlook 2007. Any ideas? Thanks much in advance! Here's my code in case it is helpful...
Public Sub New_Reply()
Dim objApp As Outlook.Application
Dim oAccount As Outlook.Account
Dim oMail As Outlook.MailItem
Set objApp = CreateObject("Outlook.Application")
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set oMail = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set oMail = objApp.ActiveInspector.CurrentItem
Case Else
End Select
Dim recip As Outlook.Recipient
Dim ae As Outlook.AddressEntry
Set recip = oMail.Recipients.Item(1)
Set ae = recip.AddressEntry
Dim sAddress As String
sAddress = ae.Address
Select Case sAddress
Case "support@domain1.com"
For Each oAccount In Application.Session.Accounts
If oAccount = "Support" Then GoTo EndCode
Next
Case "sales@domain1.com"
For Each oAccount In Application.Session.Accounts
If oAccount = "Sales" Then GoTo EndCode
Next
Case "info@domain2.com"
For Each oAccount In Application.Session.Accounts
If oAccount = "2nd Support" Then GoTo EndCode
Next
End Select
EndCode:
Set oMail = Application.ActiveExplorer.Selection(1).Reply
oMail.SendUsingAccount = oAccount
oMail.Display
End Sub