Create a Word Macro to Insert Text from Multiple Documents
Question details
The user wants to automate or streamline the process of inserting text from multiple source documents into a single destination document.

- 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.
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.
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.
Go to File > Options > Customize Ribbon and check the Developer box to enable macro features.
Press Alt + F11 to open the Visual Basic for Applications editor, then go to Insert > Module to create a new script area.
Use the 'Application.FileDialog(msoFileDialogFilePicker)' method in your VBA script to prompt the user to select one or more source files.
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.

Utilize AutoText and Quick Parts for Reusable Content
If you frequently insert the same blocks of text, AutoText is a safer and simpler alternative to VBA macros.
Assemble Files using the Master Document Feature
Use Word's built-in outlining features to link subdocuments into a single master document for printing or PDF creation.
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. Open Your Destination Document: Launch WPS Writer and place your cursor exactly where you want to insert the content from other files.
- 2. Access the Insert Menu: Navigate to the Insert tab located on the top ribbon.
- 3. Select Text from File: Click on the 'Object' drop-down arrow in the text group and choose 'Text from File'.
- 4. Choose Source Documents: Hold down the Ctrl key to select multiple source documents from your computer, then click 'Insert' to merge them instantly.

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.




