New
#20
Reply macro from within a mail item
Here is some sample code that will work from within a mail item. To reply/reply all/forward from a specific account:
This code would need to be added as 3 different macros, in the same way as the above posts.Code:Public Sub SpecificAccountReply_InMailWindow() Dim oAccount As Outlook.Account Dim oMail As Outlook.MailItem For Each oAccount In Application.Session.Accounts If oAccount = "Account Name" Then 'Set oMail = Application.ActiveExplorer.Selection(1).Reply Set oMail = ActiveInspector.CurrentItem.Reply oMail.SendUsingAccount = oAccount oMail.Display End If Next End Sub Public Sub SpecificAccountReplyAll_InMailWindow() Dim oAccount As Outlook.Account Dim oMail As Outlook.MailItem For Each oAccount In Application.Session.Accounts If oAccount = "Account Name" Then 'Set oMail = Application.ActiveExplorer.Selection(1).Reply Set oMail = ActiveInspector.CurrentItem.ReplyAll oMail.SendUsingAccount = oAccount oMail.Display End If Next End Sub Public Sub SpecificAccountForward_InMailWindow() Dim oAccount As Outlook.Account Dim oMail As Outlook.MailItem For Each oAccount In Application.Session.Accounts If oAccount = "Account Name" Then 'Set oMail = Application.ActiveExplorer.Selection(1).Reply Set oMail = ActiveInspector.CurrentItem.Forward oMail.SendUsingAccount = oAccount oMail.Display End If Next End Sub
Hope this is helpful - I know that it is a year late!