简体   繁体   English

如何在 Word 2013 中将 .dot 文件添加为宏按钮?

[英]How can I add a .dot file as a macro button in Word 2013?

I have a macro that I have coded in a VBA module, saved in a .dot file.我有一个在 VBA 模块中编码的宏,保存在 .dot 文件中。 However, when I go to Customize Ribbon in Word and try to add it, it does not show up.但是,当我转到 Word 中的自定义功能区并尝试添加它时,它没有显示。 I have tried saving it in the Word STARTUP folder as well as the Custom Office Templates folder.我曾尝试将其保存在 Word STARTUP 文件夹和自定义 Office 模板文件夹中。

I would like to have the macro set up so that it loads in all Word Documents as a clickable button on the Word toolbar/ribbon.我想设置宏,以便它作为 Word 工具栏/功能区上的可点击按钮加载到所有 Word 文档中。

I can tell you for dotm files.我可以告诉你dotm文件。 I think it should work the same for dot .我认为它应该对dot起作用。 However, you might as well switch to dotm since you have Word 2013.但是,您也可以切换到dotm因为您有 Word 2013。

  1. Exit Word.退出词。
  2. Put the dotm in %appdata%\\Microsoft\\Word\\Startup .dotm放在%appdata%\\Microsoft\\Word\\Startup You mentioned you have already done this, which is good!你提到你已经这样做了,这很好!
  3. Restart Word.重新启动 Word。
  4. Check File |检查文件 | Options |选项 | Add-Ins and make sure your dotm is listed under "Active Application Add-ins".加载项并确保您的dotm列在“活动应用程序加载项”下。
    • If not, hit "Go" at the bottom to manage "COM Add-ins," and hit the checkmark by your dotm 's name.如果没有,请点击底部的“开始”以管理“COM 加载项”,然后点击您的dotm名称的复选标记。
  5. Right-click the ribbon and select "Customize Ribbon."右键单击功能区并选择“自定义功能区”。
  6. In the "Customize Ribbon" dialog, under "Choose commands from," select the "Macros" category.在“自定义功能区”对话框中,在“从中选择命令”下,选择“宏”类别。
    • All your macros should be listed there, by project name .您的所有宏都应按项目名称列出。 You may have to hunt through the list as they will all start with Project.您可能需要浏览列表,因为它们都将从Project.开始Project. by default.默认情况下。 You can change your project's name in the VBA editor, Properties pane, to make it easier to find.您可以在 VBA 编辑器的“属性”窗格中更改项目的名称,以使其更易于查找。
  7. Choose the destination and hit Add>> .选择目的地并点击Add>>

Tested in Word 2013, Windows 8, with numerous dotm files.在 Word 2013、Windows 8 中测试,包含大量dotm文件。

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

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