以编程方式将功能区添加到Word 2007文档 [英] Adding a ribbon programatically to a Word 2007 document

查看:81
本文介绍了以编程方式将功能区添加到Word 2007文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试按照本文所述的手动方法在Word 2007文档中动态添加新的自定义功能区: -   http://msdn.microsoft.com/en-us/library/aa338202(v = office.12)的.aspx

I am trying to dynamically add a new custom ribbon in a Word 2007 document following teh manual method described in this article :- http://msdn.microsoft.com/en-us/library/aa338202(v=office.12).aspx.

本文指定以下内容: -

The article specifies the following :-

a)创建一个名为customUI.xml的XML文件,该文件将包含要在选项卡中显示的元素并放入在名为customUI的文件夹中相同。

b)将Word 2007文档重命名为.zip。添加上面的"customUI" zip文件的文件夹。

c)将以下关系添加到"_rels / rels" .zip文件中的文件: -

a) Create a XML file named customUI.xml which will contain the elements you want to display in the tab and put the same in a folder named customUI.
b) Rename your Word 2007 document to .zip. Add the above "customUI" folder to the zip file.
c) Add the following relationship to the "_rels/rels" file in the .zip file :-

<Relationship Type="http://schemas.microsoft.com/office/2006/
 relationships/ui/extensibility" Target="/customUI/customUI.xml" 
 Id="customUIRelID" />

 

我们是否有一些代码示例来使用OpenXML SDK实现上述步骤?例如,如何添加"RibbonExtensibilityPart"等。 (包含功能区XML)到文档?

Do we have some code sample to achieve the above steps using OpenXML SDK? For example, how to add the "RibbonExtensibilityPart" (which contains the ribbon XML) to the document?

 


&NBSP;&NBSP; &NBSP; string documentFileName =< docx文件的路径> ;;
     string documentFileName = <path of the docx file>;

推荐答案

Hello ashishmgupta

感谢发布。实际上,我对Open XML SDK的问题不太熟悉。但是,我会尽力给你一些有用的信息。这是一个关于流畅的UI扩展性的博客。请参考它,看看这是否可以帮助你。

Open XML SDK和Fluent UI可扩展性:

http://blogs.msdn.com/b/brian_jones/archive /2009/08/03/the-open-xml-sdk-and-fluent-ui-extensibility.aspx

如果这篇文章对你没有帮助,随便跟进。祝你有愉快的一天。


这篇关于以编程方式将功能区添加到Word 2007文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆