Reputation: 1
I am trying to create Outlook 2010 VBA code to reply\reply all to a specific email address.
Upvotes: 0
Views: 1952
Reputation: 11
I'm no Visual Basic programer but I hacked together the macro code below because I couldn't find it anywhere. It took me ages to work out myself; it's probably not best practice but it works for me.
To install it: Go to macros in Outlook, type a macro name and press Create. I called mine "ChangeReplyAddrNoPrompt". Then paste the below code (the working code is the lines between Sub() and End Sub. Then Save and Close VBA.
Then open a new message, click on the customise quick access menu and click on More Commands. Select Macros from the "Choose commands from" drop down menu. Add the macro you just created to the quick access toolbar.
Sub ChangeReplyAddrNoPrompt()
Dim mail As MailItem
Set mail = ActiveInspector.CurrentItem
mail.ReplyRecipients.Add ("[email protected]")
mail.ReplyRecipients.Add ("[email protected]")
mail.Recipients.ResolveAll
End Sub
Upvotes: 1