设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 4326|回复: 3
打印 上一主题 下一主题

自定义WORD功能区无法显示,怎么搞?

[复制链接]
跳转到指定楼层
1#
发表于 2016-3-6 20:07:29 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我想在WORD中自定义一个选项卡,代码如下,但怎么搞都不能显示选项卡,请哪位高手指点一下,问题出在哪里?
customui.xml中的代码:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">

    <ribbon startFromScratch="false">
  
        <tabs>
   
            <tab id="NewTab" visible="true" label="美化工具" insertAfterMso="TabHome" keytip="A">
   
                <group id="Group1" visible="true" label="QQ:514734691">
     
                    <menu id="menu" label="VBE风格 &#13;" imageMso="ChartTypeOtherInsertGallery"  size="large"  itemSize="large">
      
                        <button id="button1" label="关键字高亮"  imageMso="SmartArtChangeColorsGallery"  onAction="GL" />
      
                        <button id="button2" label="注释风格"  imageMso="OutlineWeightGallery"  onAction="ZS" />
      
                        <button id="button3" label="一键设置"  imageMso="GroupSmartArtQuickStyles"  onAction="YJ" />
     
                        <button id="button4" label="还原"  imageMso="FormatPainter"  onAction="HY" />
      
                        <button id="button5" label="关于"  imageMso="ObjectsSelect"  onAction="GY" />  
   
                    </menu>
   
                </group>   
   
            </tab>
  
        </tabs>

    </ribbon>

</customUI>





.rels中的代码:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
        <Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
        <Relationship Id="rId8" Type="http://schemas.microsoft.com/office/2006/relationships/ui/extensibility" Target="customUI/customUI.xml"/>       
        <Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
        <Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
</Relationships>



[Content_Types].xml中的代码:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Override PartName="/CustomUI/customUI.xml" ContentType="application/xml"/>
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/word/document.xml" ContentType="application/vnd.ms-word.document.macroEnabled.main+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/><Override PartName="/word/stylesWithEffects.xml" ContentType="application/vnd.ms-word.stylesWithEffects+xml"/><Override PartName="/word/settings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml"/><Override PartName="/word/webSettings.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml"/><Override PartName="/word/fontTable.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml"/><Override PartName="/word/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/></Types>
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅

点击这里给我发消息

2#
发表于 2016-3-7 10:01:30 | 只看该作者
建立你用几下几种方法来试
1.下载一个网上或微软可以正常使用的 Ribbon 的文件看看显示是否正常
2.如果正常,再在这个基础上修改
3.先用标准的按钮,不使用自定义的图标
4.OK后再添加自定义图标等
逐步添加内容来测试
3#
发表于 2016-3-7 11:46:39 | 只看该作者
本帖最后由 roych 于 2016-3-7 12:26 编辑

没太大问题,可能跟Menu里的标签有特殊字符有关。只不过,楼主没提供Action部分的回调函数,暂时不测试这部分。详见附件。





本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
4#
发表于 2016-5-19 12:14:13 | 只看该作者
有一个可能的问题
就是customui.xml文件中如果使用了中文
在用记事本保存时
则在保存时一定要用unicode编码
否则出不来
我多次遇到此问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-5-4 05:02 , Processed in 0.072718 second(s), 28 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表