Replace 'Space' by white color 'x'

markX
NewLounger
Posts: 2
Joined: 17 Sep 2019, 15:57

Replace 'Space' by white color 'x'

Post by markX »

I need to change the spaces between two words in MS word with a white color font 'x'. It is a huge text and doing manually will take ages. Is there any why to automate it, using macros etc? I want to select the paragraph and a single click could replace all spaces to white color 'X'. Please some body help me out.

User avatar
HansV
Administrator
Posts: 78366
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Replace 'Space' by white color 'x'

Post by HansV »

Welcome to Eileen's Lounge!

Interactively:
- Select the paragraph.
- Press Ctrl+H to activate the Replace dialog.
- Enter a space in the 'Find what' box.
- Enter an x in the 'Replace with' box.
- Click More >>.
- Click Format > Font...
- Select white as font color.
- Click OK.
- Click 'Replace All'.
- Click No when Word offers to search the rest of the document.
- Close the Replace dialog.

To automate this, create the following macro. If you want to use it in one document only, create it in that document. If you want to use it in all documents, create it in your default template Normal.dotm.

You can assign the macro to a keyboard shortcut and/or a Quick Access Toolbar button for ease of use.

Warning: replacing spaces with x will mess up word wrap and possibly page layout...
Best wishes,
Hans

User avatar
Charles Kenyon
5StarLounger
Posts: 607
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: Replace 'Space' by white color 'x'

Post by Charles Kenyon »

Is there a reason you are not using a non-breaking space instead? It will not generate spelling error marking.

markX
NewLounger
Posts: 2
Joined: 17 Sep 2019, 15:57

Re: Replace 'Space' by white color 'x'

Post by markX »

HansV wrote:Welcome to Eileen's Lounge!

Interactively:
- Select the paragraph.
- Press Ctrl+H to activate the Replace dialog.
- Enter a space in the 'Find what' box.
- Enter an x in the 'Replace with' box.
- Click More >>.
- Click Format > Font...
- Select white as font color.
- Click OK.
- Click 'Replace All'.
- Click No when Word offers to search the rest of the document.
- Close the Replace dialog.

To automate this, create the following macro. If you want to use it in one document only, create it in that document. If you want to use it in all documents, create it in your default template Normal.dotm.

You can assign the macro to a keyboard shortcut and/or a Quick Access Toolbar button for ease of use.

Warning: replacing spaces with x will mess up word wrap and possibly page layout...
Thank you Hans. It worked.