none
How to create a delete the context menu in the VSTO c# RRS feed

  • Question

  • Hi,
     
    I have developed an Addin for Office 2010. Can someone tell me how to create a context menu on right click on the cell?Is that same as we implement using the command bars? Can I use commandbars to implement the events and contextmenu? I will have to implement the context menu option for right click on the particular cell.


     private Core._CommandBarButtonEvents_ClickEventHandler m_evtExtended;
            private Core._CommandBarButtonEvents_ClickEventHandler m_evtModule;
            private Core._CommandBarButtonEvents_ClickEventHandler m_evtPVis;
            private Core._CommandBarButtonEvents_ClickEventHandler m_evtVis;
            private Core._CommandBarButtonEvents_ClickEventHandler m_evtHelp;
            private Core._CommandBarButtonEvents_ClickEventHandler m_evtInfo;
            private Core._CommandBarButtonEvents_ClickEventHandler m_evtOptions;
    
     private Core.CommandBar m_cbToolbar;
            private Core.CommandBarButton m_cbbDTool;
            private Core.CommandBarButton m_cbbTool;
            private Core.CommandBarButton m_cbbVisModule3DTool;
            private Core.CommandBarButton m_cbbExtTool;
            private Core.CommandBarButton m_cbbOptionsTool;
            private Core.CommandBarButton m_cbbInfoTool;
            private Core.CommandBarButton m_cbbHelpTool;

    this is the piece of code I am trying to implement for the context menu to create events and delete events?

    I am using .net 4.0 c# VSTO 2010 for Office 2010.

    Please help me in this.


    Roopini


    • Edited by Roopini Tuesday, January 7, 2014 3:23 AM
    Tuesday, January 7, 2014 3:20 AM

Answers

  • Hi Roopini

    VSTO extends the object models of Word and Excel, but it doesn't provide anything different in the way of events. So all the events you can use with Excel in any other kind of project are also available in a VSTO solution.

    Here's the page in the VSTO documentation on events:

    http://msdn.microsoft.com/en-us/library/7xy91eax.aspx


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, January 8, 2014 8:53 AM
    Moderator
  • Wednesday, January 8, 2014 9:34 AM
    Moderator
  • It's a good idea to have one question per thread topic. This thread has become extremely long and convoluted. I believe the original question has been answered? It would be to your advantage to start a new discussion for the continuation of your migration as very few people will read to this point in this thread. You can include a link to this thread in your new post.

    I also note that Connect.cs is not part of a standard VSTO add-in. If this is a VSTO project, you need to provide more information about the structure. And if it is a VSTO add-in, then the VSTO technology will take care of hooking up the Ribbon XML when the add-in loads.

    If this is not a VSTO add-in then you need to ask your questions in the General Office Development forum, but I recommend you read  through that first link I gave you in my last answer.

    The difference between the VSTO Ribbon Designer and a Ribbon XML project in your solution is that the Designer supports only a limited spectrum of the Ribbon technology. You cannot use it for context menus, for example.

    If you intend to use VSTO then I highly recommend you read the VSTO documentation concerning working with the Ribbon - you've been given the necessary links previously.


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Roopini Tuesday, January 14, 2014 1:56 AM
    Friday, January 10, 2014 5:24 PM
    Moderator
  • Hi Roopini

    Given your requirements:

    - context menus

    - custom name of your group in the Ribbon

    You MUST use Ribbon XML and you many NOT use the Ribbon Designer nor the CommandBars interface.

    Your starting point for learning Ribbon XML:
    http://msdn.microsoft.com/en-us/library/aa338202(v=office.12).aspx

    context menus
    http://msdn.microsoft.com/en-us/library/ee691832(v=office.14).aspx


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Roopini Tuesday, January 14, 2014 1:56 AM
    Friday, January 10, 2014 11:31 AM
    Moderator

All replies

  • Hi Roopini

    I haven't heard that Excel has dropped support of the CommandBars object model for right-click menus; I believe it should still work as it did for earlier versions. Have you tested it?

    New in Office 2010 is the capability to define customizations to the built-in context menus using the Ribbon. In this approach, the content of the context menu needs to be defined in the Ribbon XML. If the content needs to be "dynamic" then you need to use the "get" attributes to determine what is visible or enabled and refresh (invalidate) the Ribbon as appropriate.

    For this, you'd continue to use the same right-click events and logic as for the CommandBars, but the rest of the code would need to be changed.

    I'd test your existing code, first, and continue with that if it still works (and I'd expect it to). There's such a huge legacy of Excel code out there that I don't imagine support will be dropped for the CommandBars object in the near future. But you might want to double-check that with the Excel specialists in the Excel for Developers forum.


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, January 7, 2014 9:11 AM
    Moderator
  • Hi Meister,

    I had this piece of code in my earlier version of Excel addin 2003. Now the plan to implement same in the 

    VST0. But is it possible to use the same code ? Retain the same? I am using the Ribbon(Visual Designer).

    I dint get this point "rest of the code needs to be changed". I dint get this point.

    Thanks


    Roopini

    Tuesday, January 7, 2014 9:22 AM
  • Since you provide no information about the programming language and environment your 2003 code is it's not possible to answer whether it can run "as is" in VSTO for Officed 2010. All we can say is that the basic approach should continue to work.

    If you wanted to implement the context menus using the Ribbon technology then you'd have to change to use Ribbon XML, rather than the Designer.

    <<..."rest of the code needs to be changed". >>

    Chances are, even if your current code needs some modifications in order for it to work in VSTO, most of the code will stay the same. But if you use the Ribbon technology all the code that has to do with managing the context menus (CommandBars object model) would need to be rewritten.


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, January 7, 2014 10:03 AM
    Moderator
  • Hi Meister,

    These are the few samples which i have created using the old approach.

    protected override void CreateEvents()
            {
                m_evtSelectionChangeEvent =
                    new Excel.AppEvents_SheetSelectionChangeEventHandler(SelectionChangedEvent);
                m_evtChangeEvent = new Excel.AppEvents_SheetChangeEventHandler(SelectionChangedEvent);
    
                m_evtWorkbookActivateEventHandler =
                    new Microsoft.Office.Interop.Excel.AppEvents_WorkbookActivateEventHandler(WBActivateEvent);
                m_evtWorkbookDeactivateEventHandler =
                    new Microsoft.Office.Interop.Excel.AppEvents_WorkbookDeactivateEventHandler(WBDeactivateEvent);
    
                m_evtSheetActivateEventHandler =
                    new Microsoft.Office.Interop.Excel.AppEvents_SheetActivateEventHandler(SActivateEvent);
                m_evtSheetDeactivateEventHandler =
                    new Microsoft.Office.Interop.Excel.AppEvents_SheetDeactivateEventHandler(SDeactivateEvent);
    
                m_evtWorkbookOpenEventHandler =
                    new Microsoft.Office.Interop.Excel.AppEvents_WorkbookOpenEventHandler(WBOpenEvent);
    
                m_exlApplication.SheetSelectionChange += m_evtSelectionChangeEvent;
                m_exlApplication.SheetChange += m_evtChangeEvent;
    
                m_exlApplication.WorkbookActivate += m_evtWorkbookActivateEventHandler;
                m_exlApplication.WorkbookDeactivate += m_evtWorkbookDeactivateEventHandler;
    
                m_exlApplication.SheetActivate += m_evtSheetActivateEventHandler;
                m_exlApplication.SheetDeactivate += m_evtSheetDeactivateEventHandler;
    
                m_exlApplication.WorkbookOpen += m_evtWorkbookOpenEventHandler;
    
                m_evtExtendedVis = new Core._CommandBarButtonEvents_ClickEventHandler(ExtendedVis_Click);
                m_evtModuleVis = new Core._CommandBarButtonEvents_ClickEventHandler(ModuleVis_Click);
                m_evtPart3DVis = new Core._CommandBarButtonEvents_ClickEventHandler(Vis_Click);
                m_evtPart2DVis = new Core._CommandBarButtonEvents_ClickEventHandler(VisP_Click);
                m_evtOptions = new Core._CommandBarButtonEvents_ClickEventHandler(Options_Click);
                m_evtInfo = new Core._CommandBarButtonEvents_ClickEventHandler(Info_Click);//added for 13.2 requirement
                m_evtHelp = new Core._CommandBarButtonEvents_ClickEventHandler(Help_Click);
            }

     protected override void CreateContextMenu()
            {
                try
                {
                    m_cbCell = m_exlApplication.CommandBars["cell"];
                    //to make the default item appear in the pop up menu first
                    m_cbCell.Controls[1].BeginGroup = true;
                  
    
    
                    //for adding the viualization command bar popup
                    commandBar = (Core.CommandBar)m_exlApplication.CommandBars["cell"];
                    m_cbPopUp = (Core.CommandBarPopup)commandBar.Controls.Add
                        (Core.MsoControlType.msoControlPopup, MISSING, MISSING, MISSING, true);
    
                    m_cbPopUp.Caption = m_objLanguage.LBL_ENTRY_FORM;
    
                   //m_cbPopUp = (Core.CommandBarPopup)CreateCommandBarButton(m_objLanguage.LBL_ENTRY_FORM);
    
                    m_cbbVisPart2D = CreateCommandBarButton(m_objLanguage.CMD_VIS_PART_2D);
                    m_cbbVisPart2D.FaceId = PlugInConstants.BTN_FACE_ID_VIS;
                    Toolbox.SetImage(m_cbbVisPart);
                    m_cbbVisPart2D.Click += m_evtPartVis;
                    m_cbbVisPart2D.Enabled = false;
    
                    m_cbbVisPart3D = CreateCommandBarButton(m_objLanguage.CMD_VIS_PART_3D);
                    m_cbbVisPart3D.FaceId = PlugInConstants.BTN_FACE_ID_3D_VIS;
                    Toolbox.SetImage(m_cbbVisPartD);
                    m_cbbVisPart3D.Click += m_evtPartPVis;
                    m_cbbVisPart3D.Enabled = false;                
    
                    m_cbbVisModule3D = CreateCommandBarButton(m_objLanguage.CMD_VIS_MOD);
                    m_cbbVisModule3D.FaceId = PlugInConstants.BTN_FACE_ID_MODULE_VIS;
                    Toolbox.SetImage(m_cbbVisModule);
                    m_cbbVisModule3D.Click += m_evtModuleVis;
                    m_cbbVisModule3D.Enabled = false;
    
                    m_cbbExtVis = CreateCommandBarButton(m_objLanguage.LBL_VIS_EXT);
                    m_cbbExtVis.FaceId = PlugInConstants.BTN_FACE_ID_EXTENDED_VIS;
                    Toolbox.SetImage(m_cbbExtVis);
                    m_cbbExtVis.Click += m_evtExtendedVis;
                    
                    m_cbbHelp = CreateCommandBarButton(m_objLanguage.CMD_HELP);
                    m_cbbHelp.FaceId = PlugInConstants.BTN_FACE_ID_HELP;
                    Toolbox.SetImage(m_cbbHelp);
                    m_cbbHelp.Click += m_evtHelp;
                }
                catch (Exception e)
                {
                    MyMessageBox.Log(e.Message, Language.INTERNAL_E_CREATE_CONTEXT_MENU);
                }
            }
    I have used these to create context menu and FaceId's for the toolbar.


    Roopini

    Tuesday, January 7, 2014 10:13 AM
  • Hello Roopini,

    I would recommend moving your code to the Fluent UI rails. I think that command bars support will be dropped soon, in later versions, as it was with Outlook 2013. You can read more about this approach in the Customizing Context Menus in Office 2010 article in MSDN.

    Tuesday, January 7, 2014 1:00 PM
  • Hi Eugene

    I doubt that support will be dropped as quickly in Excel (or Word) as in Outlook, given the massive amounts of legacy code... That was the reason will still have VBA in Office, and the circumstance will continue to have great weight during the next ten years.

    Current support in 2010 will let them continue to leverage existing code and allow for plenty of time to plan for a future migration over the next few years, rather than immediately...


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, January 7, 2014 5:44 PM
    Moderator
  • Hi Eugene,

    Thanks for the reply, I read the link you mentioned and that was using the CustomUI, but I am not using the XML based UI customization but using the Ribbon(Visual Designer). How can I do this?

    Thanks


    Roopini

    Wednesday, January 8, 2014 2:19 AM
  • Hi Meister,

    The events which I have used , are those can be re used again in VSTO 2010 ? I am very new to VSTO, so please provide more info on this.

    Thanks


    Roopini

    Wednesday, January 8, 2014 4:30 AM
  • Hi Roopini

    VSTO extends the object models of Word and Excel, but it doesn't provide anything different in the way of events. So all the events you can use with Excel in any other kind of project are also available in a VSTO solution.

    Here's the page in the VSTO documentation on events:

    http://msdn.microsoft.com/en-us/library/7xy91eax.aspx


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, January 8, 2014 8:53 AM
    Moderator
  • Hi Meister,

    Thanks for the information. I was  asking about the 

    private Core.CommandBar m_cbToolbar; or private Core._CommandBarButtonEvents_ClickEventHandler m_evtExtendedVis;

      m_evtExtendedVis = new Core._CommandBarButtonEvents_ClickEventHandler(ExtendedVis_Click);

    are these the same way for using or registering the Button and the event ? Or should that be followed a different way of using it?

    Roopini

    Wednesday, January 8, 2014 9:27 AM
  • Wednesday, January 8, 2014 9:34 AM
    Moderator
  • Thanks Meister, the link was very helpful!!!!


    Roopini

    Wednesday, January 8, 2014 10:32 AM
  • Who knows ;)

    I can agree that VBA is a great thing and will be supported in the next Office versions, but not Command bars. The recent changes make me think about this.  

    Wednesday, January 8, 2014 1:02 PM
  • Hi Roopini,

    Please take a look at the following articles in MSDN:

    Also I have found a sample project which shows how to customize Office UI using the VSTO Designers.

    Wednesday, January 8, 2014 1:16 PM
  • Who knows ;)

    I can agree that VBA is a great thing and will be supported in the next Office versions, but not Command bars. The recent changes make me think about this.  

    CommandBars...

    • are useful for any application that needs to work with the interface out-of-process
    • for assignment of styles directly to controls in Word
    • for completely ad-hoc addition of controls to the UI
    • for the "idMso" commands and controlling taskpanes (as far as possible)

    I don't really use them, myself, any more. But IMO there's no reason to force an expensive migration for context menus at this time, or as long as things continue to work. If you have a ton of code, migrating to Ribbon XML will be a long and tedious process that needs to be carefully planned and allow for the necessary learning curve. Other things that have changed internally and need to be migrated can be given priority.


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, January 8, 2014 5:31 PM
    Moderator
  • Yes Meister, Migration to VSTO 2010 is a new concept and I dont see lot of support questions anywhere about this. But this change that was planned only for the naming the "Group" of my addin. Addin was designed in the VB first and later there was a migration to the Ribbon concept. But now again changing to the VSTO 2010 approach and just for naming the toolbar. Now if I install my addin( the previous version) the addin sits in the "Custom Toolbar" and I dint find solution to change it. Link is here. Renaming the Custom Toolbar Name . The solution was only to use the Ribbon class.

    Thanks


    Roopini

    Thursday, January 9, 2014 5:19 AM
  • Hi Roopini

    Thank you for the additional information. This is key and if you'd mentinoed it earlier we could have given you the answer right from the beginning:

    <<Now if I install my addin( the previous version) the addin sits in the "Custom Toolbar" and I dint find solution to change it.>>

    But since your subject is about CONTEXT MENUS and in your first message you state "I have developed an Addin for Office 2010. Can someone tell me how to create a context menu on right click on the cell?" that would be a rather far reach of logic for us, wouldn't it?


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, January 9, 2014 3:01 PM
    Moderator
  • Hi Meister,

    Custom toolbar renaming , i dint get any support from any forum to change it using the existing code and not migrating to the VSTO 2010. Because my addin installed properly in 2010 office also. Only issue was I wanted to name my addin in a group. I am also doing a context menu from my project , so I wanted both functionality. I dint get a good solution to change the group name using the same code than migrating :-(.


    Roopini

    Friday, January 10, 2014 5:38 AM
  • Hi Roopini

    Given your requirements:

    - context menus

    - custom name of your group in the Ribbon

    You MUST use Ribbon XML and you many NOT use the Ribbon Designer nor the CommandBars interface.

    Your starting point for learning Ribbon XML:
    http://msdn.microsoft.com/en-us/library/aa338202(v=office.12).aspx

    context menus
    http://msdn.microsoft.com/en-us/library/ee691832(v=office.14).aspx


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Roopini Tuesday, January 14, 2014 1:56 AM
    Friday, January 10, 2014 11:31 AM
    Moderator
  • Hi Meister,

    What's the difference between the two? Are theytwo don't behave same?


    Roopini

    Friday, January 10, 2014 1:20 PM
  • Hi Meister,

    This is my Connect.cs class, how to change here ? How to refer to the ribbon.xml in order to customize the GUI? What's the difference between Ribbon.xml and Ribbon Designer?

    using System;
    using Extensibility;
    using System.Runtime.InteropServices;
    using System.Timers;
    using System.Diagnostics;
    using Microsoft.Win32;
    
    using Daimler.Engineering.Visualization.WebService;
    using Daimler.Engineering.Visualization.AddIn;
    using Daimler.Engineering.Visualization.UI;
    using DaiEngVisCommon;
    using Microsoft.Office.Core;
    
    namespace Daimler.Engineering.Visualization
    {
        #region Read me for Add-in installation and setup information.
        // When run, the Add-in wizard prepared the registry for the Add-in.
        // At a later time, if the Add-in becomes unavailable for reasons such as:
        //   1) You moved this project to a computer other than which is was originally created on.
        //   2) You chose 'Yes' when presented with a message asking if you wish to remove the Add-in.
        //   3) Registry corruption.
        // you will need to re-register the Add-in by building the DaiEngVisualizationExcelAddInSetup project, 
        // right click the project in the Solution Explorer, then choose install.
        #endregion
    
        /// <summary>
        ///   The object for implementing an Add-in.
        /// </summary>
        /// <seealso class='IDTExtensibility2' />
        [GuidAttribute("AAF80996-2B7E-4F6B-8285-0C26E6A10DFF"), ProgId("Daimler.Engineering.Visualization.Connect")]
        public class Connect : Object, Extensibility.IDTExtensibility2
        {
            /// <summary>
            ///		Implements the constructor for the Add-in object.
            ///		Place your initialization code within this method.
            /// </summary>
            public Connect()
            {           
            }
    
            /// <summary>
            ///      Implements the OnConnection method of the IDTExtensibility2 interface.
            ///      Receives notification that the Add-in is being loaded.
            /// </summary>
            /// <param term='application'>
            ///      Root object of the host application.
            /// </param>
            /// <param term='connectMode'>
            ///      Describes how the Add-in is being loaded.
            /// </param>
            /// <param term='addInInst'>
            ///      Object representing this Add-in.
            /// </param>
            /// <seealso class='IDTExtensibility2' />
            public void OnConnection(object application, Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array custom)
            {           
                try
                {
    
                    if (key == null || key.GetValue("Enable").ToString() == "1")
                    { //starting the adiin
                        m_objAddInInstance = (Microsoft.Office.Core.COMAddIn)addInInst;
                        if (application is Microsoft.Office.Interop.Excel.Application)
                        {
                            m_objOfficeComponent = new ExcelComponent((Microsoft.Office.Interop.Excel.Application)application);                      
    
                        }
                        else
                        {
                            System.Windows.Forms.MessageBox.Show("");
    
                        }
    
                        sw.Stop();
    
                        MyMessageBox.Log("sw.ElapsedMilliseconds : ", sw.ElapsedMilliseconds.ToString());
                        MyMessageBox.Log("sw.Elapsed.TotalMilliseconds : ", sw.Elapsed.TotalMilliseconds.ToString());
                        MyMessageBox.Log("sw.ElapsedTicks : ", sw.ElapsedTicks.ToString());
                        //m_objOfficeComponent.Init();
                   }
                    
                }
                catch (Exception e)
                {
                    MyMessageBox.Log(e.Message,e.StackTrace);
                    System.Windows.Forms.MessageBox.Show(e.Message);
                }
            }
    
            /// <summary>
            ///     Implements the OnDisconnection method of the IDTExtensibility2 interface.
            ///     Receives notification that the Add-in is being unloaded.
            /// </summary>
            /// <param term='disconnectMode'>
            ///      Describes how the Add-in is being unloaded.
            /// </param>
            /// <param term='custom'>
            ///      Array of parameters that are host application specific.
            /// </param>
            /// <seealso class='IDTExtensibility2' />
            public void OnDisconnection(Extensibility.ext_DisconnectMode disconnectMode, ref System.Array custom)
            {
                if (key == null || key.GetValue("Enable").ToString() == "1")
                {                
                    //System.Windows.Forms.MessageBox.Show("Esi Visualisierung wurde deaktiviert.");
                    // Wenn msgbox da, gibt es keinen fehler!?!?!
                    m_objOfficeComponent.Delete();
                    m_objOfficeComponent = null;
                    m_objAddInInstance = null;
                    
                    }
                }
            }
    
            /// <summary>
            ///      Implements the OnAddInsUpdate method of the IDTExtensibility2 interface.
            ///      Receives notification that the collection of Add-ins has changed.
            /// </summary>
            /// <param term='custom'>
            ///      Array of parameters that are host application specific.
            /// </param>
            /// <seealso class='IDTExtensibility2' />
            public void OnAddInsUpdate(ref System.Array custom)
            {
                //m_objGlobalConfig = new Config();
                //m_objGlobalConfig.CheckHistory = false;
                //m_objGlobalConfig.ConfirmOKClick = false;
               
             
            }
    
            /// <summary>
            ///      Implements the OnStartupComplete method of the IDTExtensibility2 interface.
            ///      Receives notification that the host application has completed loading.
            /// </summary>
            /// <param term='custom'>
            ///      Array of parameters that are host application specific.
            /// </param>
            /// <seealso class='IDTExtensibility2' />
            public void OnStartupComplete(ref System.Array custom)
            {
                if (key == null || key.GetValue("Enable").ToString() == "1")
                {
                    m_objOfficeComponent.Init(); // this is moved from the OnConnection method due to the performance
                }
            }
    
            /// <summary>
            ///      Implements the OnBeginShutdown method of the IDTExtensibility2 interface.
            ///      Receives notification that the host application is being unloaded.
            /// </summary>
            /// <param term='custom'>
            ///      Array of parameters that are host application specific.
            /// </param>
            /// <seealso class='IDTExtensibility2' />
            public void OnBeginShutdown(ref System.Array custom)
            {
                
            }
            private OfficeComponent m_objOfficeComponent;
            private Microsoft.Office.Core.COMAddIn m_objAddInInstance;
            RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Office\\Excel\\AddIns\\ExtendedAddIn.Connect", true);
    
          
        }
    }
    Can you help me in this?

    Roopini

    Friday, January 10, 2014 2:33 PM
  • It's a good idea to have one question per thread topic. This thread has become extremely long and convoluted. I believe the original question has been answered? It would be to your advantage to start a new discussion for the continuation of your migration as very few people will read to this point in this thread. You can include a link to this thread in your new post.

    I also note that Connect.cs is not part of a standard VSTO add-in. If this is a VSTO project, you need to provide more information about the structure. And if it is a VSTO add-in, then the VSTO technology will take care of hooking up the Ribbon XML when the add-in loads.

    If this is not a VSTO add-in then you need to ask your questions in the General Office Development forum, but I recommend you read  through that first link I gave you in my last answer.

    The difference between the VSTO Ribbon Designer and a Ribbon XML project in your solution is that the Designer supports only a limited spectrum of the Ribbon technology. You cannot use it for context menus, for example.

    If you intend to use VSTO then I highly recommend you read the VSTO documentation concerning working with the Ribbon - you've been given the necessary links previously.


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Roopini Tuesday, January 14, 2014 1:56 AM
    Friday, January 10, 2014 5:24 PM
    Moderator
  • Hi Meister,

    Thanks for the information. Is it possible to use ribbon designer for the Addin and Ribbon XML for the context menu?

    Thanks.


    Roopini

    Monday, January 13, 2014 6:10 AM
  • Hi Roopini,

    Since the orignal issue has been resolved, if you have any other questions please reopen a new thread.

    It will involve more communitiy members to the question.

    Thanks for your understanding.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, January 13, 2014 1:10 PM
    Moderator
  • What kind of solution would be responsible for the context menu?

    Cindy Meister, VSTO/Word MVP, my blog

    Monday, January 13, 2014 6:22 PM
    Moderator
  • Hi Fei,

    Thanks Fie, I have have opened the new question.


    Roopini

    Tuesday, January 14, 2014 2:05 AM
  • Hi Meister,

    I thought to have a Ribbon Visual Designer for addins and Ribbon XML for context menu in the same project.



    Roopini

    Tuesday, January 14, 2014 2:06 AM
  • Hi Roopini

    You cannot combine Ribbon Designer and Ribbon XML in the same add-in project. That's because a single add-in can load only one Ribbon customization.

    This discussion has all become very complex and I can't remember anymore who has said what, but...

    You can use old CommandBars code AND Ribbon in the same project. I think I mistakenly said you had to choose one or the other. So you could, theoretically, continue to do the context menus with the old approach and define Ribbon buttons with the new one. If you decide to do this it would probably be a very good idea to document the choices you've made and the reason for them.


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, January 14, 2014 2:18 PM
    Moderator