How to Replace Every Word in Word While Preserving Capitalization
Question details
The user wants to replace all words in a document with a specific new word, but needs to maintain the original capitalization patterns (such as lowercase, uppercase, or title case).

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Performing a bulk text replacement in a document without losing the distinct text case formatting of the original words.
- Observed behavior
- Standard find and replace tools overwrite words exactly as typed in the replacement field, requiring a workaround to preserve the original capitalization state.
Before running a bulk replacement with wildcards or a macro, turn on 'Show/Hide Formatting Marks' to better see word boundaries, and ensure you are positioned at the beginning of the document.
Use Advanced Find and Replace with Wildcards
Utilize Word's wildcard functionality to target lowercase and capitalized words separately, replacing them with the appropriately cased target word.
This method involves running the Find and Replace operation multiple times to target different capitalization patterns. The wildcards allow Word to differentiate between words that start with a lowercase letter versus those that start with an uppercase letter.
Press Ctrl+H on your keyboard to open the Find and Replace dialog box.
Click the 'More' button to expand the search options, and check the box next to 'Use wildcards'.
In the 'Find what' box, type <[a-z]*>. In the 'Replace with' box, type your replacement word in lowercase (e.g., sun). Click 'Replace All'.
Clear the 'Find what' box and type <[A-Z]*>. In the 'Replace with' box, type your replacement word with a capital letter (e.g., Sun). Click 'Replace All'.

Use a VBA Macro for Complex Patterns
Create and run a custom VBA script to automatically detect each word's case and apply the correct replacement while perfectly preserving uppercase, lowercase, or title case.
Perform Advanced Text Replacements with WPS Writer
WPS Writer provides a powerful Find and Replace tool equipped with wildcard support, enabling you to execute precise text edits and formatting adjustments just as easily as in Microsoft Word.
- 1. Launch the Find and Replace Tool: Open your document in WPS Writer and press Ctrl+H to access the Replace menu.
- 2. Access Advanced Options: Click the 'Advanced' button in the dialog box to reveal extended search parameters, then check 'Use wildcards'.
- 3. Execute the Replacement: Input your wildcard patterns (such as <[a-z]*>) and your appropriately cased replacement text, then click 'Replace All'.

Frequently Asked Questions
Does the standard 'Match case' option preserve capitalization during replacement?
No, checking 'Match case' only forces Word to find text that exactly matches the case you typed in the search box. It does not dynamically adapt the replacement text to match the original word's capitalization.
Can I easily undo a 'Replace All' action if I mess up my document formatting?
Yes, 'Replace All' counts as a single action in your document's history. You can revert all the replacements instantly by pressing Ctrl+Z immediately after executing the command.
Why didn't my wildcard search replace words that are entirely uppercase?
If you used the <[A-Z]*> wildcard, it targets words starting with an uppercase letter, which includes both Title Case and ALL CAPS. To target only words that are entirely uppercase, you would need a more specific wildcard expression or to run a VBA macro that checks the case of the entire string.




