给Outlook 2007的Calendar视图增加个右键菜单项
实现环境:Visual Studio 2010, Office 2007, VSTO 4.0
[csharp]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Outlook = Microsoft.Office.Interop.Outlook;
using Office = Microsoft.Office.Core;
namespace OutlookAddIn7
{
public partial class ThisAddIn
{
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
Application.ViewContextMenuDisplay += new Outlook.ApplicationEvents_11_ViewContextMenuDisplayEventHandler(Application_ViewContextMenuDisplay);
}
void Application_ViewContextMenuDisplay(Office.CommandBar CommandBar, Outlook.View View)
{
if (View is Outlook.CalendarView)
{
Office.CommandBarButton btn = (Office.CommandBarButton)CommandBar.Controls.Add();
btn.Caption = "Test";
}
}
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
{
}
#region VSTO generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(ThisAddIn_Startup);
this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
}
- 发表评论
-
- 最新评论 进入详细评论页>>
今日头条
更多>>您可能感兴趣的文章
- ASP.ENT前台更改绑定数据的日期格式
- 让asp.net mvc的Action支持jQuery直接提交的javascript对
- DCOM--高效率主从服务器程序的新概念
- 使用HttpWebRequest下载经过重定向的文件
- .NET类库中发现设计模式:策略模式
- Asp.net MVC源码分析--UrlRoutingModule与Service location的
- .Net插件框架的实现及分析(二)
- C#高级编程:使用XPath命名空间中的类[2]
- .NET简谈设计模式之(装饰者模式性能问题?)
- Add View -> Strongly-typed view ->Model Class



