コード例 #1
0
ファイル: WordHelper.cs プロジェクト: liang860908/quality
 //添加单独的菜单项
 public void AddMenu(Microsoft.Office.Core.CommandBarPopup popuBar)
 {
     Microsoft.Office.Core.CommandBar menuBar = null;
     menuBar = this.OWordApplic.CommandBars["Menu Bar"];
     popuBar = (Microsoft.Office.Core.CommandBarPopup) this.OWordApplic.CommandBars.FindControl(Microsoft.Office.Core.MsoControlType.msoControlPopup, missing, popuBar.Tag, true);
     if (popuBar == null)
     {
         popuBar = (Microsoft.Office.Core.CommandBarPopup)menuBar.Controls.Add(Microsoft.Office.Core.MsoControlType.msoControlPopup, missing, missing, missing, missing);
     }
 }
コード例 #2
0
        public static Microsoft.Office.Core.CommandBarPopup AddNewPopup(this Microsoft.Office.Core.CommandBarPopup cmdbarpopup, string tag, string caption)
        {
            var new_popup = (Microsoft.Office.Core.CommandBarPopup)cmdbarpopup.Controls.Add(
                Microsoft.Office.Core.MsoControlType.msoControlPopup, // Type
                missing,                                              // Object
                missing,                                              // Id
                cmdbarpopup.Controls.Count + 1,                       // Before
                true                                                  // Temporary
                );

            new_popup.Caption = caption;
            new_popup.Tag     = tag;
            return(new_popup);
        }
コード例 #3
0
        public static Microsoft.Office.Core.CommandBarButton AddNewMenuItem(this Microsoft.Office.Core.CommandBarPopup cmdbarpopup,
                                                                            string tag,
                                                                            string caption,
                                                                            Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler handler)
        {
            var before_pos = cmdbarpopup.Controls.Count + 1;

            var btn = (Microsoft.Office.Core.CommandBarButton)cmdbarpopup.Controls.Add(
                Microsoft.Office.Core.MsoControlType.msoControlButton, // Type
                missing,                                               // Object
                missing,                                               // Id
                before_pos,                                            // Before
                true                                                   // Temporary
                );

            btn.Style   = Microsoft.Office.Core.MsoButtonStyle.msoButtonIconAndCaption;
            btn.Caption = caption;
            btn.Tag     = tag;
            btn.Click  += handler;

            return(btn);
        }
コード例 #4
0
ファイル: CommandBarPopup.cs プロジェクト: shairad/Rubberduck
 public CommandBarPopup(Microsoft.Office.Core.CommandBarPopup target)
     : base(target)
 {
 }
コード例 #5
0
 public CommandBarPopup(Microsoft.Office.Core.CommandBarPopup target, bool rewrapping = false)
     : base(target, rewrapping)
 {
 }