Share via


Creating a Word Add-in

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

You should create an add-in when:

  • Your solution does not require boilerplate text or custom styles.
  • You want to make some functionality available to any document the user creates, through toolbar buttons, menu commands, or macros.

To create a Word add-in

  1. Create a Microsoft® Word document. Then, from the File menu, select Save As, and select Word Document Template in the Save as Type box.
  2. From the Tools menu, select Macro, and then select Visual Basic Editor.
  3. From the File menu, select New Project, and then select Add-In Project.
  4. Specify the new add-in, and add code that creates a new toolbar with buttons that call your code when they are clicked.
  5. From the Debug menu, select Compile ProjectName.
  6. If you want, you can protect the project from viewing, as described in Securing an Access, Excel, PowerPoint, or Word Add-in's VBA Project.
  7. Save the template as type Document Template with the .dot extension.

To change the default path for templates

  1. In Word, from the Tools menu, select Options.

  2. In the Options dialog box, select the File Locations tab.

  3. From the File types list, select User templates, and then click Modify.

    Note   If you want the add-in to load automatically when you start Word, save the add-in to the Word Startup folder. In addition, you can modify the default location for workgroup templates in the Options dialog box. Workgroup templates are templates that you share on a network with other users.

See Also

Word Add-ins | Loading a Word Add-in | Running Code When a Word Add-in Is Loaded or Unloaded | Word Templates