Office Settings & Configuration

Create a Word Macro to Insert Text from Multiple Documents

Aamir Naveed AkramAamir Naveed Akram Nov 4, 2026 871 views

Question details

The user wants to automate or streamline the process of inserting text from multiple source documents into a single destination document.

How to Create a Word Macro to Insert Text from Multiple Documents
Product
Microsoft Word
Device & OS
not provided
Scenario
Assembling a large document from multiple smaller source files or reusing specific text blocks systematically.
Observed behavior
Needs an efficient method, such as VBA macros, AutoText, or file selection dialogs, to extract specific text from selected files and insert it into a target document.
Before you start

Ensure you have the Developer tab enabled in your word processor to access VBA features, and always create a backup of your destination document before running new macros or using the Master Document feature.

Solution 1Recommended

Use VBA and the FileDialog Property

Create a macro that opens a file picker to select source documents and uses Range objects to copy and paste text.

Using a VBA macro gives you full control over selecting multiple files and specifying exactly where the text should be inserted. The Application.FileDialog property is ideal for creating a file or folder picker interface.

1
Enable the Developer Tab

Go to File > Options > Customize Ribbon and check the Developer box to enable macro features.

2
Open the VBA Editor

Press Alt + F11 to open the Visual Basic for Applications editor, then go to Insert > Module to create a new script area.

3
Write the FileDialog Script

Use the 'Application.FileDialog(msoFileDialogFilePicker)' method in your VBA script to prompt the user to select one or more source files.

4
Insert the Text

Write a loop in your code to open each selected file, copy the desired Range or Bookmarks, paste them into the destination document's Range, and close the source files without saving.

Use VBA and the FileDialog Property
Third-Party Add-ins: If you prefer not to write code from scratch, you can explore third-party add-ins, such as Graham Mayor's 'Boiler' add-in, which are specifically built for assembling multiple documents.

Easily Merge Documents with WPS Writer

WPS Writer provides straightforward tools to insert text from multiple files without needing complex VBA code, while maintaining full compatibility with Microsoft Word documents.

  1. 1. Open Your Destination Document: Launch WPS Writer and place your cursor exactly where you want to insert the content from other files.
  2. 2. Access the Insert Menu: Navigate to the Insert tab located on the top ribbon.
  3. 3. Select Text from File: Click on the 'Object' drop-down arrow in the text group and choose 'Text from File'.
  4. 4. Choose Source Documents: Hold down the Ctrl key to select multiple source documents from your computer, then click 'Insert' to merge them instantly.
Fully compatible with Microsoft Word (.docx) formats.Built-in 'Text from File' feature for seamless document assembly.Lightweight, fast performance for handling large documents.Supports advanced macro functionality in professional editions.
microsoft office alternative - wps office

Frequently Asked Questions

Can I insert text from multiple documents without using a macro?

Yes. In most modern word processors, you can use the 'Insert > Object > Text from File' feature to select multiple documents and insert their contents directly into your current file without writing any VBA code.

Why is my Master Document corrupting?

The Master Document feature can become unstable when heavily edited. It is best practice to keep subdocuments separate for editing and only create the Master Document temporarily to assemble the parts, update the table of contents, and export to PDF or print.

How do I enable the Developer tab to write VBA macros?

Go to File > Options > Customize Ribbon, and check the box next to 'Developer' in the main tabs list. This will add the tab to your ribbon, giving you access to the VBA Editor, macro recording, and code tools.

What is the difference between AutoText and Quick Parts?

AutoText is a specific type of Quick Part used primarily for storing and inserting reusable text blocks. Quick Parts is the overarching gallery that contains AutoText entries, document properties, and dynamic fields.