none
Loading Custom Ribbon.xml in Office 2013 by COM-addins developed for Office 2007. RRS feed

  • Question

  • Hello,

    I have created 2 ribbons.xml in an Addin project for an Office 2007 app by VS 2008.

    Ribbon1.XML -> is loaded for Office 2007 and the second one, Ribbon2.xml -> is loaded for Office 2013.

    In the Ribbon constructor I have done OfficeVersion check and in GetCustomUI(string ribbonID) loading the appropriate ribbon for that Office Version. For Office 2007, its customized ribbon is loaded nicely, but for Office 2013 the customized ribbon is not loading. Below is code where it checks the officeVersion and loads the required ribbon.

    public string GetCustomUI(string ribbonID)
    {        
       if (pptVersion == 15)
       {
         return GetResourceText("PowerPointAddIn.PowerPointRibbon2013.xml");
       }
       else if (pptVersion == 12)
       {
           return GetResourceText("PowerPointAddIn.PowerPointRibbon2007.xml");
       }
       else
       {
          return GetResourceText("PowerPointAddIn.BasicRibbon.xml");
       }
    }

    The Office 2013 app is also not showing an error. Is that the correct procedure to load different custom ribbons.xml through 1 single addin built for a different version of Office? 

    Regards,

    Sayan



    Tuesday, May 27, 2014 11:45 AM

Answers

  • Hi Sayan,

    In Office 2013, the custom XML looks like:

    <customUI xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui">
    <ribbon>
    …
    </ribbon>
    

    In Office 2007, it looks like:

    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon>
    …
    </ribbon>
    

    Is this the case? 

    Also, you could check whether the code below was executed or not:

    if (pptVersion == 15)
       {
         return GetResourceText("PowerPointAddIn.PowerPointRibbon2013.xml");
       }
    
    If the information above does not give you help,would you mind sharing the whole sample for us to trouble shoot?


    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.


    Wednesday, May 28, 2014 3:52 AM
    Moderator

All replies

  • Hi Sayan,

    In Office 2013, the custom XML looks like:

    <customUI xmlns:mso="http://schemas.microsoft.com/office/2009/07/customui">
    <ribbon>
    …
    </ribbon>
    

    In Office 2007, it looks like:

    <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
    <ribbon>
    …
    </ribbon>
    

    Is this the case? 

    Also, you could check whether the code below was executed or not:

    if (pptVersion == 15)
       {
         return GetResourceText("PowerPointAddIn.PowerPointRibbon2013.xml");
       }
    
    If the information above does not give you help,would you mind sharing the whole sample for us to trouble shoot?


    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.


    Wednesday, May 28, 2014 3:52 AM
    Moderator
  • Hi George,

    Thanks for the response.

    Your 2nd instruction to check the code solved the problem.

    Actually I made a mistake in adding the ribbon.xml for office 2013. I added it manually( Add->Existing Item-> PowerPointRibbon2013.xml). But later added it as Ribbon(XML) from New Item Template and it solved the issue.

    The GetResourceText(string ) looks for the xml passed with the xml present in the assembly(myAddin.dll) and if it matches, then returns the whole xml else returns null. So previously it returned null as PowerPointRibbon2013.xml was not present in the assembly. 

    Regards,

    Sayan.

    Wednesday, May 28, 2014 10:37 AM