New Outlook VSTO AddIn: How to disable Reply To All and Forward in Outlook 2007
2010 UPDATE: Gavin has released an updated version of his No Reply To All Add-In on the Microsoft Research Site. Go get it free!
Last October I posted a Macro-quasi-hack to Disable Reply To All and Forward in Outlook within your own company network. The technique uses a macro to flip a metadata bit in a message.
Of course the only REAL way truly to disable Reply to All and Forward is to use IRM (Intellectual Rights Management) in Outlook 2003/7. However, this technique was useful to a lot of people as it is super simple and can stop those "knee-jerk" Reply to Alls.
Anyway, after this post Gavin Smyth of Microsoft Research emailed me and said:
"However, it's still such a useful idea that I finally got round to writing a C# addin to do it (vaaaassst overkill, I know, but it was easy) - toggle buttons (one for reply, one for forward) on the ribbon that set the two flags appropriately."
Cool. He's written his first Visual Studio Tools for Office (VSTO) AddIn, and it's a good tutorial on how to write one!
The general idea os:
- Start with the VS Outlook Add-In project wizard
- Add the ribbon group & buttons
- Create click event handlers for both, replicating what was in your my blog posting
Poof. Package and Deploy. It's really obscenely easy. Actually, way easier than the macro way I did it.
Now my Messages have these nice shiny new icons:
The source is trivial:
using System;
using Microsoft.Office.Tools.Ribbon;
using Outlook = Microsoft.Office.Interop.Outlook;
using Office = Microsoft.Office.Core;
namespace NoReplyAllAddin
{
public partial class Ribbon : OfficeRibbon
{
public Ribbon() { InitializeComponent(); }
private bool SetActionFromButton( object sender, object context, string action )
{
bool oldValue = false;
Outlook.Inspector inspector = context as Outlook.Inspector;
if( inspector != null )
{
Outlook.MailItem msg = inspector.CurrentItem as Outlook.MailItem;
if( msg != null )
{
oldValue = msg.Actions[ action ].Enabled;
RibbonToggleButton btn = (RibbonToggleButton)sender;
msg.Actions[ action ].Enabled = !btn.Checked;
}
}
return oldValue;
}
private void OnClickNoReplyAll( object sender, RibbonControlEventArgs e )
{
SetActionFromButton( sender, e.Control.Context, "Reply to All" );
}
private void OnClickNoForward( object sender, RibbonControlEventArgs e )
{
SetActionFromButton( sender, e.Control.Context, "Forward" );
}
}
}
You can download the setup and/or the source for Gavin's "No Reply for Outlook 2007" over at his Software Utilities site. Thanks to Gavin!
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
Thanks for the awesome find.
Yep, ReplyAll is a scourge of most teams - it's killing email (well, certainly for most people using it for work). The trouble is sometimes people would like the choice of seeing the conversation.
Given that problem, we're trying to do something about it with 'another way' rather than 'on or off', and building on what we did with Taglocity 1.0 (you kindly spoke about it here). To get an idea of the vibe then there's a video to watch which gives the high level overview.
As we have some Taglocity Groups in use at Microsoft then give us a shout if you want to play with it, you'll be most welcome - we're in closed beta but in fact anyone that mentions that they read your blog I'll make sure gets in.
PS Did I shill, I think I might of, but it was kinda relevant :-)
PPS See you at PDC this year?
Comments are closed.
Just a thought: I wonder how difficult it would be to also disable the Forward/ReplyAll buttons in the main Outlook window (when using the reading pane instead of opening the message in a new window). The buttons are still enabled, although they give a message ("action not available for this item").