outlook添加CommandBar和CommandBarButton
来源:互联网 发布:成品油批发价年度数据 编辑:程序博客网 时间:2024/06/10 06:38
如果您不明白 CommandBar和CommandBarButton,建议您看看office编程。看一些概念性的东西。虽然是vba的,但是照猫画虎还是可以的。
添加CommandBar
////// 添加bar(小荷扬扬原创) /// public class Addbar { CommandBar bar; public Addbar(CommandBars bars, string caption) { //返回具有指定caption的工具栏,如果不存在添加 try { bar = bars[caption]; bar.Visible = true; } catch (System.Exception) { bar = (CommandBar)bars.Add(caption, MsoBarPosition.msoBarTop, false, true);//Temporary参数指出Outlook应该在Outlook会话间保持命令栏 bar.Protection = MsoBarProtection.msoBarNoResize | MsoBarProtection.msoBarNoChangeDock; bar.Visible = true; } } public CommandBar getBar() { return bar; } }
添加CommandBarButton
////// 添加按钮的基类(小荷扬扬原创) /// public class Btn { protected CommandBarButton MyButton;//要添加的按钮 protected Outlook.Application applicationObject; public Btn() { } /// /// 工具栏添加按钮 /// /// 要添加按钮的工具栏 /// 按钮的标题 /// outlook应用程序 public Btn(CommandBar commandbar, string caption, Outlook.Application applicationObject) { try { if (applicationObject!=null ) { this.applicationObject = applicationObject; } MyButton = (CommandBarButton)commandbar.Controls[caption]; } catch (System.Exception) { object omissing = System.Reflection.Missing.Value; MyButton = (CommandBarButton)commandbar.Controls.Add(MsoControlType.msoControlButton, omissing, omissing, omissing, omissing); MyButton.Caption = caption; MyButton.Style = MsoButtonStyle.msoButtonCaption;//显示按钮外观和标题文本的msoButtonIconAndCaption MyButton.Visible = true; MyButton.Click += new _CommandBarButtonEvents_ClickEventHandler(MyButton_Click); } } /// /// 菜单栏添加按钮 /// /// 要添加按钮的菜单栏 /// 标题 /// outlook应用程序 public Btn(CommandBarPopup barPopup, string caption, Outlook.Application applicationObject) { try { if (applicationObject!=null ) { this.applicationObject = applicationObject; } MyButton = (CommandBarButton)barPopup.Controls[caption]; } catch (System.Exception) { object omissing = System.Reflection.Missing.Value; MyButton = (CommandBarButton)barPopup.Controls.Add(MsoControlType.msoControlButton, omissing, omissing, omissing, omissing); MyButton.Caption = caption; MyButton.Style = MsoButtonStyle.msoButtonCaption; MyButton.Visible = true; MyButton.Click += new _CommandBarButtonEvents_ClickEventHandler(MyButton_Click); } } /// /// 按钮的单击事件 /// /// 按钮 /// 时间是否取消 public virtual void MyButton_Click(CommandBarButton Ctrl, ref bool CancelDefault) { } /// /// 返回添加的按钮 /// /// 返回添加的按钮 public CommandBarButton getButton() { return MyButton; } }
- outlook添加CommandBar和CommandBarButton
- 无敌的Word CommandBar和它的Control们
- 如何:向 Outlook 添加自定义菜单和菜单项
- 【Office Outlook】账户添加
- Outlook 2007 添加Quick Part
- LDAP整合Outlook和Outlook Express
- Outlook Express和Outlook的区别
- Cmailserver和outlook配置
- outlook插件 邮件群发系统 outlook添加按钮 outlook添加窗口
- AppBar到CommandBar
- 在Outlook中添加自己的菜单
- 在Outlook中添加自己的菜单
- Windows Mail(Outlook Express)添加图片签名
- OutLook中添加、取消送信者禁止
- Outlook中添加中国农历节日
- 将Outlook.com添加到Android设备
- 调出outlook,添加附件(不发送)
- google calendar 和outlook同步
- TCP/IP详解(1)
- 剪影_优秀与自省
- Liferay Portal的Action中应用JNI
- 身体的小秘密
- 将DataSet数据集导入CSV后缀文件中
- outlook添加CommandBar和CommandBarButton
- Silverlight,你应该知道的10件事
- Intel OpenMP
- Web Service“四长两短”
- 使用Telnet登录邮箱
- SQL按时间模糊查询
- apache认证访问
- 最长公共子序列问题
- webconfig 详解