简体   繁体   English

EPPlus-更新自定义功能区元素

[英]EPPlus - Update Custom Ribbon Elements

I have a excel file which contains several items in a custom ribbon. 我有一个Excel文件,其中包含自定义功能区中的多个项目。 I've added these custom elements with Microsoft's " Custom UI Editor for Microsoft Office ", my customization looks something like the following: 我已经使用Microsoft的“ Microsoft Office的自定义UI编辑器 ”添加了这些自定义元素,我的自定义如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
   <ribbon>
      <tabs>
         <tab id="XXX" label="XXX" insertAfterMso="TabInsert">
            <group id="YYY" label="YYY">
                <button id="btnXXX" 
                    label="XXXX" 
                    imageMso="PivotTableNewStyle" 
                    size="large" 
                    onAction="ZZZZ" 
                    screentip="XXX" 
                    supertip="XXX" />
            </group>
        </tab>
      </tabs>
   </ribbon>
</customUI>

I would like to modify(Add remove elements, change elements) this header with EPPlus, is this possible? 我想用EPPlus修改(添加删除元素,更改元素)此标头,这可能吗? If so how would it be done? 如果是这样,将如何进行?

I have not found a way to do this in EPPlus, but I have found a way to edit it with the " DocumentFormat.OpenXml " library. 我没有找到在EPPlus中执行此操作的方法,但已经找到了使用“ DocumentFormat.OpenXml ”库进行编辑的方法。 Specifically to access that portion of the file I use the following code: 专门用于访问文件的那部分,我使用以下代码:

((SpreadsheetDocument)document.WorkbookPart.OpenXmlPackage).RibbonAndBackstageCustomizationsPart

I'm still not sure if it can be done in EPPlus. 我仍然不确定是否可以在EPPlus中完成。 Maybe in a future version... 也许在将来的版本中...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM