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.