How to add menus in outlook menu bar using object model?

InfoPath alternatives for form designing SharePoint
In this post, we will discuss how to add menus in outlook menu bar using C#.Net object model. Also, you can check out my previous posts on:
Here is the code to add menubar in outlook plugin application using object model.
private Office.CommandBar menuBar;
        private Office.CommandBarPopup newMenuBar;
        private Office.CommandBarButton buttonFeedback;
And in the ThisAddIn_Startup you can write the following lines of code that will show the menu  in the menu bar.
 menuBar = this.Application.ActiveExplorer().CommandBars.ActiveMenuBar;
    newMenuBar = (Office.CommandBarPopup)menuBar.Controls.Add(
                    Office.MsoControlType.msoControlPopup, missing,
                    missing, missing, true);
 if (newMenuBar != null)
                    newMenuBar.Caption = “My&Menu”;
                    newMenuBar.Tag = menuTag;
 buttonFeedback = (Office.CommandBarButton)newMenuBar.Controls.Add(Office.MsoControlType.msoControlButton, missing, missing, 1, true);
                    buttonFeedback.Style = Office.MsoButtonStyle.msoButtonIconAndCaption;
                    buttonFeedback.Caption = “Customer &Feedback Option”;
//Face ID will use to show the ICON in the left side of the menu.
                    buttonFeedback.FaceId = 3737;
 newMenuBar.Visible = true;
//You can also add event handlers for the menus.
                buttonFeedback.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(buttonFeedback_Click);

You May Also like the Following SharePoint Online Tutorials:

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site

View all posts by Bijay Kumar →

Leave a Reply