Saturday, December 06, 2008

Enabling Reply To All in Outlook

Update: See http://neilmitchell.blogspot.com/2011/12/enabling-reply-to-all-in-outlook.html for an updated version of this functionality.

Some companies lock down the use of Outlook by disabling the Reply To All button. This makes it harder to manage email, and requires manually copying email addresses to get the same effect. But using a bit of Office VBA, it is possible to make a functioning Reply To All button. The following solution has been tested in Outlook 2003, but should work for older versions as well.

First, enable macros in Outlook. Go to Tools, Macro, Security and select Medium or Low security.

Second, add a Reply To All action. Go to Tools, Macro, Visual Basic Editor and put the following code in the text editor.


Option Explicit

Public Sub ReallyReplyAll()
Dim o As MailItem
Set o = Application.ActiveExplorer.Selection.Item(1)
o.ReplyAll.Display
End Sub


Finally, add a toolbar button to invoke the action. Go to Tools, Customise, Commands, Macros, and drag and drop the command Project1.ThisOutlookSession.ReallyReplyAll on to the toolbar. You can put this command exactly where you used to have Reply To All, and give it the same icon/name.

To test, select an email and click on the button you just added, it should do exactly what Reply To All would have done. There are some minor limitations to this method:


  • The button will not disable itself when it isn't applicable, i.e. when there are no emails selected. You will still be able to click on the button, but it won't do anything.

  • If you select a medium level of macro security, you will have to go through a security confirmation the first time you click Reply To All in an Outlook session.


If possible, try to educate the person in charge that Reply To All is perfectly good email etiquette, and that people should be trusted to use it responsibly. However, if that fails, the above method is a useful fallback.

17 comments:

Anonymous said...

If possible, try to educate the person in charge that Reply To All is perfectly good email etiquette, and that people should be trusted to use it responsibly.

the problem is that the people who disable reply to all are typically uneducateable
they THOUGHT that disabling was a good idea in the first place
they THOUGHT they had some reason for this
but they are always wrong

Anonymous said...

hi, I can't seem to make this work - the macro does not show up. What do I need to do between pasting the text in the text editor and adding the button?

Neil Mitchell said...

Anon: Should be nothing, but perhaps try saving and restarting Outlook if it doesn't work.

I know these people are uneducatable - if I thought they could be educated I wouldn't deliberately go against their wishes :-)

Shirish said...
This comment has been removed by the author.
Shirish said...

THANK YOU! this is a great save!

this such a great piece that i have been using it all day (so you can say that i am miss-using it)

However, there is one thing that happens to the mail, it looses the formatting that is typically set for a mails that i compose. Hence the time that is saved (and i am grateful for that) in manually copying and pasting addresses is partly utilised in resetting the formatting...

could you suggest a solution?

Neil Mitchell said...

Shirish: Hmm, no idea - it should be equivalent to clicking on Reply, since that's all I invoke. I don't have any formatting set, so haven't noticed anything. I'll have a play when I get a spare moment and see if I can fix this.

mathi said...

Thanks Neil!

What a time saver! I love it. Yesterday the Reply to all was turned off company-wide. Today I am back in business thanks to you!

Thanks again and best regards,

Mathi

Alex said...

Hi Neil,

Having been strong-armed into providing this workaround to a bunch of guys, I have streamlined the process a bit. The result is the code pasted below.

This does a couple of things on top of your solution:

1. Adds a button to the toolbar in an open mail, as well as the main outlook toolbar

2. Gives you a macro to simplify the installation of the buttons. Simply open a mail from the inbox and run 'InsertRTAButton'. This will create the required buttons (with the correct icons) and map the appropriate macros to them.

Simply paste the following into a new VBA module. (Apologies for the lack of comments - was never meant for public consumption.)

Option Explicit

Public Sub InsertRTAButton()

Dim myButton As CommandBarButton
Dim NewCtrl As CommandBarControl
Dim myBar As CommandBar
Dim myOlApp As Application
Dim myNamespace As NameSpace
Dim picPicture As IPictureDisp
Dim picMask As IPictureDisp
Dim mailIn As MailItem

Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = Application.GetNamespace("MAPI")
Set myButton = myOlApp.Explorers.Item(1).CommandBars("Standard").Controls.Add(Type:=msoControlButton, Before:=1)
myButton.OnAction = "ToAllInbox"
myButton.FaceId = 17
myButton.Visible = True

' Set picPicture = stdole.StdFunctions.LoadPicture("c:\Misc\replytoall.bmp")
' Set picMask = stdole.StdFunctions.LoadPicture("c:\Misc\replytoall.bmp")

' myButton.Picture = picPicture
' myButton.Mask = picMask
myButton.Visible = True
myButton.Style = msoButtonIconAndCaption
myButton.Caption = "Reply To All"

Set NewCtrl = myOlApp.Explorers.Item(1).CommandBars.FindControl(Type:= _
msoControlButton, ID:= _
myOlApp.Explorers.Item(1).CommandBars("Standard").Controls("Reply").ID)
NewCtrl.CopyFace
myButton.PasteFace

Set mailIn = Application.ActiveInspector.CurrentItem
Set myButton = mailIn.Application.ActiveInspector.CommandBars("Standard").Controls.Add(Type:=msoControlButton, Before:=1)
myButton.OnAction = "ToAllMail"
myButton.FaceId = 17
myButton.Visible = True

myButton.Visible = True
myButton.Style = msoButtonIconAndCaption
myButton.Caption = "Reply To All"

Set NewCtrl = mailIn.Application.ActiveInspector.CommandBars.FindControl(Type:= _
msoControlButton, ID:= _
mailIn.Application.ActiveInspector.CommandBars("Standard").Controls("Reply").ID)
NewCtrl.CopyFace
myButton.PasteFace

End Sub

Public Sub ToAllMail()
' This works from the open mail item.

Dim mailIn As MailItem
Dim mailOut As MailItem
Dim myFolder As MAPIFolder
Dim myOlApp As Application
Dim myNamespace As NameSpace

Set myOlApp = CreateObject("Outlook.Application")
Set myNamespace = Application.GetNamespace("MAPI")
Set myFolder = myNamespace.GetDefaultFolder(olFolderInbox)
Set mailIn = Application.ActiveInspector.CurrentItem

Set mailOut = mailIn.ReplyAll

mailOut.Display

End Sub

Public Sub ToAllInbox()
' This works from the inbox.

Dim mailIn As MailItem
Dim mailOut As MailItem
Dim myFolder As MAPIFolder
Dim myOlApp As Application
Dim myOlExp As Outlook.Explorer
Dim myOlSel As Outlook.Selection

Set myOlApp = CreateObject("Outlook.Application")
Set myOlExp = myOlApp.ActiveExplorer
Set myOlSel = myOlExp.Selection

Set mailIn = myOlSel.Item(1)

Set mailOut = mailIn.ReplyAll

mailOut.Display

End Sub

Alex said...

Regarding the font issue - in my view this is a bug in Outlook, in that it does not seem to realise that we are replying, despite having invoked that function.

I think the workaround I found was to go to tools->options->mail format->fonts and click 'always use my fonts'.

Note that I think this picks up your chosen 'new mail' font, rather than 'reply' font when you hit the reply-to-all button. Better than nothing though...

Neil Mitchell said...

Hi Alex,

That's great - your code should be the one people use. We have two options:

1) I update the page at http://community.haskell.org/~ndm/office/ with your code (and say it's your version).

2) You upload the code to a web page somewhere, and I point mine to link at yours.

What do you want to do?

Thanks for the improvements, Neil

gergo-erdi said...

I've found this really helpful. And funny that your site was the first hit in Google...

gergo-erdi said...

Do you have a similar workaround for "Edit"/"Edit message" not working for incoming mails?

Neil Mitchell said...

Gergo: I have no idea what you are talking about with the Edit/Edit message? How do I get to the disabled button? Outlook 2003 or 2007?

gergo-erdi said...

So when you open an individual incoming message for viewing, you have an 'Edit' menu in Outlook 2003. One of the menu items in that menu is 'Edit message'. Likewise, in Outlook 2007, it's in the 'Other Actions' dropdown menu. This is the menu item (not toolbar button) that is disabled at... some... institutions.

Neil Mitchell said...

Gergo: See my recent blog post, http://neilmitchell.blogspot.com/2011/12/enabling-reply-to-all-in-outlook.html, which allows editing messages.

Anonymous said...

Neil
Thanks your code is concise and does what it says on the tin! Mathi's may be in some way more functional, but I have never seen a better example of over-engineering. What ever happened to the KISS principle.

Anonymous said...

i used ctrl+shift+R and it worked