Populate CustomUI for Excel 365 Backstage

Home Forums Open-Xml-Sdk Populate CustomUI for Excel 365 Backstage

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  Nick 8 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3306

    Nick
    Participant

    Hi
    I am developing a version of the CustomUI utility for my own purposes. I started with code from MSDN which sets up the original CustomUI element for Office 2007, but I can’t find how to implement the backstage in this version.

    The original code is:

        Using document As SpreadsheetDocument = SpreadsheetDocument.Open(fileName, True) 
          ' You can only have a single ribbon extensibility part. 
          ' If the part doesn't exist, add it. 
          Dim part = document.RibbonExtensibilityPart 
          If part Is Nothing Then 
            part = document.AddRibbonExtensibilityPart 
          End If 
          part.CustomUI = New CustomUI(customUIContent) 
          part.CustomUI.Save() 
        End Using 

    If customUIcontent contains XML with <backstage> tags (using xmlns= “http://schemas.microsoft.com/office/2009/07/customui”), this code fails.

    I used the original utility to insert the sample backstage into a workbook. On inspection of the XML (in a watch), I find an additional element RibbonAndBackstageCustomizationsPart. I tried to replicate the original code, substituting RibbonAndBackstageCustomizationsPart for RibbonExtensibilityPart – but this failed on the part.CustomUI = New CustomUI(customUIContent) line.

    On further examination of the XML content in my sample, I find innerXML and outerXML which have variants of the original XML where the tags have “mso14” prefix (which is presumably why CustomUI shows CustomUI14.xml separate from CustomUI12.xml parts).

    I have searched extensively for help on how to populate the RibbonAndBackstageCustomizationsPart element with my XML, but failed to find the right syntax.

    Can anyone tell me the proper method to populate this element, please?

    I am using the Open XML 2.5 SDK with VS 2012.

    Many thanks.
    Nick

    • This topic was modified 8 years, 9 months ago by  Nick.
    #3327

    Eric White
    Keymaster

    Hi,

    Unfortunately, I don’t have the experience in this area.

    What documentation does MS provide on the RibbonAndBackstageCustomizationsPart?

    -Eric

    #3342

    Nick
    Participant

    Hi Eric
    Thanks for your reply. I got an answer from StackOverflow.com, which pointed out that I had used the wrong library.
    As to Microsoft documentation, I found nothing helpful.
    Much appreciated.
    Nick

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.