Public Class ThisAddIn Private WithEvents tyINS As Outlook.Inspectors Private WithEvents tyAI As Outlook.AppointmentItem Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup tyINS = Me.Application.Inspectors End Sub Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown End Sub Private Sub tyINS_NewInspector(ByVal Inspector As Microsoft.Office.Interop.Outlook.Inspector) Handles tyINS.NewInspector tyAI.S() tyAI = Inspector.CurrentItem If tyAI.MessageClass = "IPM.Appointment" Then Dim f As New TyApptItem() f.Show() Else End If End Sub Private Sub tyAI_Open(ByRef Cancel As Boolean) Handles tyAI.Open Cancel = True End Sub Private Sub tyAI_Send() Handles tyAI. End Class 代码中的窗体是自己随便建的. C# 代码(OUTLOOK2003): public partial class ThisApplication { Outlook.Inspectors tyINS; Outlook.AppointmentItem tyAO; private void ThisApplication_Startup(object sender, System.EventArgs e) { tyINS = this.Inspectors; tyINS.NewInspector += new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(tyINS_NewInspector); } void tyINS_NewInspector(Microsoft.Office.Interop.Outlook.Inspector Inspector) { tyAO = (Outlook.AppointmentItem)Inspector.CurrentItem; tyAO.Open += new Microsoft.Office.Interop.Outlook.ItemEvents_10_OpenEventHandler(tyAO_Open); if (tyAO.MessageClass == "IPM.Appointment") { Form1 f = new Form1(); f.Show(); } } void tyAO_Open(ref bool Cancel) { Cancel = true; tyAO.Open -= new Microsoft.Office.Interop.Outlook.ItemEvents_10_OpenEventHandler(tyAO_Open); } private void ThisApplication_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(ThisApplication_Startup); this.Shutdown += new System.EventHandler(ThisApplication_Shutdown); } #endregion }
自由广告区 |
分类导航 |
邮件新闻资讯: IT业界 | 邮件服务器 | 邮件趣闻 | 移动电邮 电子邮箱 | 反垃圾邮件|邮件客户端|网络安全 行业数据 | 邮件人物 | 网站公告 | 行业法规 网络技术: 邮件原理 | 网络协议 | 网络管理 | 传输介质 线路接入 | 路由接口 | 邮件存储 | 华为3Com CISCO技术 | 网络与服务器硬件 操作系统: Windows 9X | Linux&Uinx | Windows NT Windows Vista | FreeBSD | 其它操作系统 邮件服务器: 程序与开发 | Exchange | Qmail | Postfix Sendmail | MDaemon | Domino | Foxmail KerioMail | JavaMail | Winwebmail |James Merak&VisNetic | CMailServer | WinMail 金笛邮件系统 | 其它 | 反垃圾邮件: 综述| 客户端反垃圾邮件|服务器端反垃圾邮件 邮件客户端软件: Outlook | Foxmail | DreamMail| KooMail The bat | 雷鸟 | Eudora |Becky! |Pegasus IncrediMail |其它 电子邮箱: 个人邮箱 | 企业邮箱 |Gmail 移动电子邮件:服务器 | 客户端 | 技术前沿 邮件网络安全: 软件漏洞 | 安全知识 | 病毒公告 |防火墙 攻防技术 | 病毒查杀| ISA | 数字签名 邮件营销: Email营销 | 网络营销 | 营销技巧 |营销案例 邮件人才:招聘 | 职场 | 培训 | 指南 | 职场 解决方案: 邮件系统|反垃圾邮件 |安全 |移动电邮 |招标 产品评测: 邮件系统 |反垃圾邮件 |邮箱 |安全 |客户端 |