Word 2010:如何在Qat中创建下拉菜单(快速访问工具箱) [英] Word 2010: how to create a drop-down menu in qat (quick access toolbox)

查看:231
本文介绍了Word 2010:如何在Qat中创建下拉菜单(快速访问工具箱)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

快捷方式: 我想通过在Word的启动文件夹中放置自定义的.dotm文件,向Word 2010的任何实例的快速访问工具栏添加一个下拉菜单.我无法创建该自定义的.dotm文件.

SHORT: I would like to add a drop-down menu to the quick access toolbar of any instance of Word 2010 via placing a customized .dotm-file in Word's startup folder. I fail in creating this customized .dotm-file.

: 我一直在为Word 2010写一些插件",首先使用VSTO,然后找出部署方面的问题,现在使用VBA.加载项应简化将我公司的徽标和法律声明添加到文档中(存在徽标和法律声明的不同组合).

LONG: I've been writing a little "add-in" for Word 2010, first with VSTO, then figured out problems with the deployment, now with VBA. The add-in should simplify adding my company's logo and legal notice to documents (different combinations of logos & legal notices exist).

为了尽可能少地单击即可选择希望的徽标和法律声明,我考虑过自动向快速访问工具栏(qat)添加一个下拉菜单.我想通过放置一个包含此qat-extension&代码的代码的.dotm文件来完成此操作用户的Word启动文件夹中页眉/页脚设置的逻辑.

In order to allow selection of wished logo and legal notice with as few clicks as possible, I thought about automatically adding a drop-down menu to the quick access toolbar (qat). I want to do this by placing a .dotm-file containing the code for this qat-extension & the logic for the header/footer-setting in the user's Word startup-folder.

我已经成功地使用CustomUI将这样的下拉菜单添加到Add-Ins-Ribbon中,在代码方面一切正常.通过菜单,用户可以从提供的所有预设中进行选择,并成功添加页眉和页脚.

I have already succeded in adding such a drop-down menu to the Add-Ins-Ribbon using CustomUI, everything works fine on the code side. Via the menu the user can choose from all presets supplied and headers and footers are added successfully.

此外,我已经看过并玩过将控件直接直接添加到qat的示例.

Furthermore, I have seen and played with examples that successfully add controls directly to the qat.

如果将这些示例放在我的启动文件夹中,则可以很好地完成工作,并且其中定义的控件会出现在Word的任何实例上.可行的方法是在.dotm文档中创建一个新文件夹"userCustomization",然后创建具有多个限制(例如,不允许使用自定义图标)的customUI.xml文件.

If placed in my startup-folder, these examples do a perfect job and the controls defined therein appear on any instance of Word. The way to go is to create a new folder "userCustomization" in the .dotm-document and then create the customUI.xml-file with several restrictions (no custom icons allowed e.g.).

不幸的是,我无法弄清楚如何在qat中实现下拉菜单控件.我发现的所有示例仅使用简单"(按钮)控件,无论我尝试将多个按钮包装在标签中的次数是多少,我都无法正常工作.

Unfortunately, I was not able to figure out how to implement a drop-down-menu control in the qat. All the examples I found only used "simple" (button) controls and no matter how many times whatsoever I tried wrapping buttons in a tag, i never got it working.

另一方面,我可以通过"qat =>添加控件"将我的功能区手动添加到qat和..voilà..那里,可以按需工作,所以我想这一定是可能的.但是我需要使它自动化,以便我们的用户不必对qat进行任何配置.

I can on the other hand manually add my ribbon via "qat => add controls" to the qat and .. voilà .. it's there, working exactly as wanted, so i suppose it must be possible. But what I need is to automate this so that our users don't have to do any configuration of the qat.

非常感谢您的帮助!来自德国的问候, 库尔特

Help would be very much appreciated! Best regards from Germany, Kurt

这是将下拉菜单添加到加载项"选项卡的方式:

This is how the drop-down menu is added to the Add-Ins-tab:

<ribbon>  
<tabs>  
<tab idMso="TabAddIns">    
<group id="MyGroup" label="WordDesigner" visible="false">       

    <menu id="myMenu" label="Design einfügen" size="large" image="menulogo">
    <menu id="mySubMenu" label="Rechnungswesen" image="icon2">  
        <button id="MahnUndKlage"  label="Mahn- und Klage" image="icon3" onAction="DesignAnwenden"/> 
        <button id="Buchhaltung"  label="Buchhaltung" image="icon3" onAction="DesignAnwenden"/>    
    </menu>
    <button id="Personalabteilung"  label="Personalabteilung" image="icon3" onAction="DesignAnwenden"/>
    <button id="Verkauf"  label="Verkauf" image="icon4" onAction="DesignAnwenden"/>
    <button id="clearHeaderAndFooter"  label="Gestaltung entfernen" image="icon5" onAction="DesignAnwenden"/>   
    </menu>
</group>
</tab>
</tabs>
</ribbon>
</customUI>

我发现的有用信息包括:

Usefull information I found included:

推荐答案

好吧,更多的研究导致了更多的信息(...),如果其他人可能会搜索类似的问题,我会尽力总结我得到的..

Alright, some more research has led to some more information ( ... ) and in case anybody else might ever search for a similar question, I'll try to conclude what i got..

  • 1)根据

  • 1) According to this MS page on the QAT, only Button, ToggleButton and CheckBox are valid items for the QAT in Win7 (Win8 allows some more controls).

由于您还可以手动添加下拉菜单,因此我认为必须有某种自动完成操作以及按钮,复选框和切换按钮的方法

Since you can manually add drop-down-menus as well, I thought there had to be some way to do that automatically as well as with buttons, checkboxes and togglebuttons

我可能一辈子都没有办法自动添加 通过修改启动文件夹中.dotm文件的userCustomization-Folder中的customUI.xml文件,将其下拉到QAT.

I could for the life of me not figure out a way to auto-add a drop-down to the QAT by modifying the customUI.xml-file in the userCustomization-Folder of a .dotm-file in startup folder.

还有另一种可能性可以实现该目标:Office 2010使用 类型为".officeUI"的文件,其中存储了每个用户元素 来自QAT(例如Word.officeUI).在其中添加以下xml-Element可以确保,如果您将包含菜单的.dotm文件放在其中 Word的启动文件夹,它在加载时显示为下拉菜单 QAT:

There is one other possibility to achieve that goal: Office 2010 uses a file of the type ".officeUI" where it stores each users elements from the QAT (e.g. Word.officeUI). In there, adding the following xml-Element will make sure that, if you have placed the .dotm-file containing your menu in Word's startup folder, it is on load displayed as a drop-down in the QAT:

<mso:control idQ="x1:myMenu" visible="true"/>

不幸的是,将这个xml-Element热情地添加到userCustomization中的customUI.xml中会导致.. poof ..根本没有用户在QAT中定义额外的图标(customUI.xml损坏).

Unfortunatly, enthusiastically adding this xml-Element to the customUI.xml in userCustomization results in .. poof .. no user defined extra icons in the QAT at all (customUI.xml is corrupt).

此外,我昨天偶然发现的一个很好的资源是Andy Pope的 Visual Ribbon编辑器.您可以轻松调整功能区和QAT.

Furthermore, a great ressource I stumbled upon yesterday is Andy Pope's Visual Ribbon Editor. You can easily tweak the Ribbon and QAT.

这篇关于Word 2010:如何在Qat中创建下拉菜单(快速访问工具箱)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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