How to Stop Word From Underlining and Bolding Inserted Images
Question details
Users need a way to stop Microsoft Word from automatically applying bold or underline text styles to images that are programmatically inserted into a document.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Using an automated program or script to insert images into Word documents based on existing placeholder text.
- Observed behavior
- The inserted images inherit the character formatting of the placeholder text, causing the images themselves to appear with visible bolding or underlines.
Ensure you have permission to run VBA macros in your Microsoft Word environment, or have access to modify the source code of the automation program.
Use a Word VBA Macro to Clear Image Formatting
Run a VBA script to automatically scan the document and strip text formatting like bold and underline from all inline shapes.
This method is ideal if you cannot modify the external automated program. When an image is placed 'In Line with Text', Word treats it as a text character. The macro targets these inline shapes and resets their font attributes, effectively removing the unwanted underlining and bolding without altering the document structure.
Press 'Alt + F11' in Microsoft Word to open the Microsoft Visual Basic for Applications window.
Go to the 'Insert' menu at the top and select 'Module' to create a blank script window.
Enter a VBA script that iterates through ActiveDocument.InlineShapes. For each shape, select its range and set both Range.Font.Bold to False and Range.Font.Underline to wdUnderlineNone.
Press 'F5' on your keyboard or click the 'Run' button. The script will execute and instantly clear the formatting from all inserted images in the document.

Modify the Automation Program's Source Code
Update the program that inserts the images to apply a neutral, unformatted style to the image range immediately after insertion.
Easily Manage Document Formatting with WPS Writer
WPS Writer offers robust tools for handling document formatting and supports automated macros to easily clear unwanted styles from inserted images, streamlining your workflow.
- 1. Open Your Document in WPS Writer: Launch WPS Office and open the document containing the automated images.
- 2. Access the Developer Tab: Navigate to the 'Developer' tab on the top ribbon to access macro functions.
- 3. Create a Formatting Macro: Click 'Macros', create a new script, and input your VBA code to strip underline and bold styling.
- 4. Execute the Macro: Run the macro to instantly remove bold and underline styles from all inline images across the document.

Frequently Asked Questions
Why do my inserted images have an underline in Word?
Images inserted with the 'In Line with Text' wrapping style are treated by Word as large text characters. If the text cursor or placeholder they replace has underline formatting applied, the image will automatically inherit that styling.
Can I manually remove the bold or underline from an individual image?
Yes. You can highlight the image by clicking and dragging your cursor over it (treating it exactly like a letter), then click the Bold or Underline buttons on the Home tab to toggle the inherited formatting off.
Does changing the image text wrapping fix the underline issue?
Yes. If you select the image and change its text wrapping from 'In Line with Text' to 'Square', 'Tight', or 'In Front of Text', the image is no longer treated as a text character and will immediately drop any font formatting like underlines.




