Building and customizing solutions using Microsoft 365 Copilot APIs and tools
VBA macros in Word are stored in documents or templates, not in Copilot itself. Copilot only helps generate the code; it does not control where it is saved.
In Word, macros are typically saved in one of these locations:
- The current document/template (e.g., a
.docmfile or a custom template) - The global template (
Normal.dotm), which holds default macros and customizations
If the macros no longer appear in the Macros list:
- Check the macro storage location
- In Word, go to View > Macros > View Macros.
- In Macros in, change the dropdown to:
-
Normal.dotm(orAll active templates and documents) to see if the macros were stored in the global template.
-
- If they appear there, they are still present but were just filtered out by the dropdown selection.
- Check that the file type supports macros
- Macros cannot be saved in a standard
.docxfile. - To retain macros, the document must be saved as a Word Macro-Enabled Document (
.docm) or in a macro-enabled template. - If the document was saved as
.docx, any macros created in that document would not be saved.
- Macros cannot be saved in a standard
- Open the Visual Basic Editor to search for modules
- Enable the Developer tab if needed:
- File > Options > Customize Ribbon > Main Tabs > Developer (check it) > OK.
- On the Developer tab, select Visual Basic.
- In the Project pane, expand:
-
Normal(forNormal.dotm) and any open documents/templates.
-
- Look under Modules for the code Copilot generated.
- Enable the Developer tab if needed:
- Be aware of template/customization issues after updates
- Word customizations (macros, autotext, styles) are often stored in
Normal.dotm. - After some Office updates, this file can be renamed or replaced, causing macros to appear “missing.”
- If customizations disappeared after an update, they may be in a renamed
Normaltemplate in the templates folder (for example, a previousNormal.dotmrenamed by an update). Restoring that file name can bring back macros and other customizations.
- Word customizations (macros, autotext, styles) are often stored in
Once the macros are located in Normal.dotm or a .docm file, they will appear again in the Macros dropdown when that template/document is loaded.
References: