vsto 启用 禁用加载项_新的Outlook VSTO加载项:如何禁用Outlook 2007中的全部答复和转发...

博客介绍了如何使用VSTO(Visual Studio Tools for Office)创建一个Outlook加载项,该加载项通过C#实现,提供一键禁用邮件的回复所有人和转发功能。作者分享了Gavin Smyth的源代码,用户可以在Outlook 2007中下载和使用这个加载项,以帮助减少不必要的‘全部回复’。
摘要由CSDN通过智能技术生成
vsto 启用 禁用加载项

vsto 启用 禁用加载项

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!

2010更新:Gavin在Microsoft研究站点上发布了他的“对所有加载项均不答复”的更新版本 去免费获得!

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.

去年10月,我发布了一个宏准黑客程序,以在您自己的公司网络内的Outlook中禁用全部答复和转发功能 该技术使用宏来翻转消息中的元数据位。

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.

当然,真正禁用全部回复和转发的唯一真正方法是在Outlook 2003/7中使用IRM(知识产权管理)。 但是,这种技术非常简单,它可以阻止很多“下跪的人”回复所有人,因此对很多人都有用。

Anyway, after this post Gavin Smyth of Microsoft Research emailed me and said:

无论如何,在这篇文章发表之后,微软研究院的Gavin Smyth给我发了电子邮件,说:

"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."

但是,它仍然是一个非常有用的想法,我终于回过头来编写一个C#插件来做到这一点(我知道这很简单,但是很容易)-在功能区上切换按钮(一个用于回复,一个用于转发)适当地设置两个标志。”

Cool. He's written his first Visual Studio Tools for Office (VSTO) AddIn, and it's a good tutorial on how to write one!

凉。 他已经编写了他的第一个Visual Studio Office for Office(VSTO)插件,这是一个很好的教程。

image

The general idea os:

总体思路os:

  • Start with the VS Outlook Add-In project wizard

    从VS Outlook加载项项目向导开始
  • 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.

of 打包和部署。 这真的很容易。 实际上,它比我做的宏方法容易得多。

Now my Messages have these nice shiny new icons:

现在,我的消息中有这些漂亮的闪亮新图标:

NoReplyButtons

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!

您可以在他的“软件实用程序”站点上下载Gavin的“ Outlook 2007无回复”的设置和/或源代码。 感谢加文!

翻译自: https://www.hanselman.com/blog/new-outlook-vsto-addin-how-to-disable-reply-to-all-and-forward-in-outlook-2007

vsto 启用 禁用加载项

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值