Others

How to Export and Share a Word 2016 Macro

Amos GikundaAmos Gikunda Nov 25, 2026 868 views

Question details

Export a Word 2016 macro or share its code with another user.

How to Export and Share a Word 2016 Macro
Product
Microsoft Word 2016
Device & OS
not provided
Scenario
A user wants to transfer a Word macro to another user's VBA project.
Observed behavior
The recipient needs a module file or macro code that can be added to a VBA project in Word.
Before you start

Open Word 2016 and identify the document or template that contains the macro. In the Visual Basic Editor, check whether the macro is in a standard module by itself or alongside other code.

Solution 1Recommended

Export the macro module as a .bas file

Use this method to share a standard module, especially when it contains only the macro you want to send.

1
Open the VBA editor

In Word, press Alt+F11 to open the Visual Basic Editor. If Project Explorer is hidden, select View > Project Explorer.

2
Find the module

In Project Explorer, expand the relevant document or template project and its Modules folder, then open the module containing the macro.

3
Export the module

Right-click the module in Project Explorer, select Export File, and save the resulting .bas file.

4
Share and import the file

Send the .bas file to the recipient. In their Visual Basic Editor, they can select the destination project, choose File > Import File, and select the .bas file.

Export the macro module as a .bas file
The whole module is exported: A .bas export includes all code in that standard module. If it contains macros you do not want to share, copy only the required code instead.
Free Microsoft Office alternative

Work with Word documents in WPS Office

WPS Office is a free, lightweight alternative for working with Word documents. Its familiar interface and Microsoft Office format support make it easy to move everyday document work across, although it does not export macros from Word's VBA editor.

Open and edit Microsoft Word DOC and DOCX filesUse a familiar document-editing interfaceWork with shared Word documents in a lightweight office suiteMove everyday document editing to WPS Office for free
microsoft office alternative - wps office

Frequently Asked Questions

Does exporting a module export every macro in it?

Yes. Right-clicking a standard module and choosing Export File saves all its code in the .bas file. To share just one macro, copy its procedure into a text file instead.

Where should the recipient import the macro?

In the Visual Basic Editor, the recipient can select the destination document or template project in Project Explorer, then choose File > Import File and select the .bas file.

Why might an imported macro not run?

It may rely on helper code, references, or other components that were not included. Check the original VBA project for dependencies, and review Word's macro security settings before running code from a trusted source.

Can I save a macro in a regular .docx file?

A .docx file cannot store VBA macros. To retain macros in a document, use File > Save As and select a Word Macro-Enabled Document (.docm).