How to Insert Text Before Highlighted Words in Word
Question details
The user needs a way to automatically insert specific characters (like three asterisks) immediately before all highlighted text segments in a document.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Editing a lengthy document where yellow-highlighted segments need to be systematically prefixed with a specific text string or symbol for emphasis or formatting purposes.
- Observed behavior
- The user wants to automate the text insertion to avoid the manual and time-consuming process of typing characters before every single highlighted word.
Ensure you save a copy of your document before performing bulk find and replace operations, so you can easily revert the changes if the formatting outcome is not what you expected.
Use Advanced Find and Replace (No Macro Needed)
Use Word's built-in Find and Replace tool along with formatting options and special codes to quickly add text before any highlighted segment.
This is the most efficient method for users who prefer not to use VBA scripts. By utilizing the '^&' special character in the Replace field, you can preserve the original text while appending or prepending new characters.
Press the Ctrl + H shortcut on your keyboard to open the Find and Replace dialog box.
Click on the 'More >>' button in the bottom left corner of the dialog box to reveal advanced search options.
Click inside the 'Find what' text box and leave it empty. Click the 'Format' button at the bottom, choose 'Highlight' from the dropdown menu. The word 'Highlight' will appear below the 'Find what' box.
Click inside the 'Replace with' text box. Type your desired prefix followed by '^&'. For example, type '***^&' to insert three asterisks before the highlighted text. The '^&' code represents the original highlighted text.
Click 'Replace All' to automatically apply the changes to every highlighted segment throughout the entire document.

Use a VBA Macro for Specific Highlight Colors
Run a VBA script if you only want to target a specific highlight color, such as yellow, while ignoring other highlighted colors.
Edit Documents Faster with WPS Writer
WPS Writer fully supports advanced Find and Replace functionalities, allowing you to seamlessly manipulate formatted text, highlights, and styles with ease. It is a highly capable alternative for all your word processing needs.
- 1. Open your Document: Launch WPS Writer and open the document containing the highlighted text.
- 2. Access Find and Replace: Press Ctrl + H to bring up the Find and Replace dialog.
- 3. Apply Highlight Formatting: Leave 'Find what' blank, click 'Options', choose 'Format' > 'Highlight'.
- 4. Replace and Keep Text: In 'Replace with', type '***^&' and click 'Replace All'.

Frequently Asked Questions
What does the ^& symbol do in Word's Replace field?
The '^&' code stands for 'Find What Text'. It instructs the word processor to keep the exact text it just found and allows you to append or prepend whatever characters you type around it.
Can I remove the highlights during the Find and Replace process?
Yes. If you want to insert text and simultaneously remove the highlight, you can place your cursor in the 'Replace with' field, click 'Format', select 'Highlight' twice so it says 'Not Highlight', and then click 'Replace All'.
Does Find and Replace work on specific highlight colors?
No, the standard 'Format > Highlight' search in the Find and Replace dialog looks for any text that has a highlight applied, regardless of the specific color. To target only one color (e.g., yellow), you must use a VBA macro.
Will this method work for text with specific font colors instead of highlights?
Yes. Instead of choosing 'Highlight' in the Format menu for the 'Find what' field, you can choose 'Font' and select the specific font color you want to target. The '^&' replacement logic remains exactly the same.




