Skip to content

Replace text with filler - a manual approach

Here’s a manual method of replacing text with filler or anonymous words in Microsoft Word

Use this when you need help with a Word document formatting problem but can’t share the troublesome .docx because it contains confidential information.

Our head honcho, Peter Deegan, had this problem himself.  A friend asked for help with a Word numbering problem but could not show him the contract document for obvious client confidentiality reasons.  Without seeing the document and trying some possible fixes, it’s almost impossible to help.

What’s needed is a way to replace the words or letters with filler or anonymous text that doesn’t give away anything private but retains the original formatting.  The best way to do that is to replace each word with another word with the same number of characters.

For example, here’s a ‘confidential’ document with a mysterious list problem in the first section (1.a then 1.h ?).

Before sharing the private Word document, change the words to hide the real content like this:

We wrote a simple VBA macro which replaces each letter with a random letter,  but that has some limitations.  The main one is that many Word users aren’t comfortable with VBA macros.

Manual Replaces

Here’s another way to do the same thing, without any VBA.  It’s a little laborious and time consuming but does the job.

It uses Word’s advanced ‘wildcards’ Replace to find words of a certain length and replace with a fixed filler word.  For example, all 4 letter words are replaced with ‘four’, ‘fine’, ‘chef’ or ‘beef’.

Word’s ‘wildcards’ Find option is really ‘Regular Expressions’ or ‘Regex’ a favorite of digital geeks around the world.  It’s wonderfully powerful but incredibly precise.  One character out of place and the whole ‘regex’ can fail or do very strange things.

Advanced Replace

For Word nerds, we’ll give a quick explanation here.  There’s a longer Replace with Filler text ‘step by step’ for those of us who haven’t done this kind of thing before.

Here’s the full Replace dialog.

Use Wildcards – must be ON.  This is vital.

Find:

Use this expression exactly:

([!a-zA-Z])[a-zA-Z]{4}([!a-zA-Z])

It’s best to copy/paste the whole expression.

Only change the digit in the curly brackets to change the word length.  {1} {2} {3} etc.

No spaces before, after or inside the expression.

Replace:

Again, use this expression exactly with no extra spaces.

\1four\2

Change the word between \1 and \2  for any word of the same length as the digit you’ve got in the Find expression.  ‘a’ , ‘be’, ‘sea’, ‘four’ etc.

Do that for each word length from 1 to as many as you need.

Numbers

Randomizing digits is easier, just replace all digits with a single digit like  9 or 0.  This will leave all currency signs, thousand separators and decimals in place.

Use Wildcards – must be ON.  This is vital.

Find:

Use this expression exactly:

[0-9]{1}

No spaces before, after or inside the expression.  It’s best to copy/paste the whole expression.

Replace:

Just the digit you want to use as filler, with no extra spaces.

9

About this author

Office-Watch.com

Office Watch is the independent source of Microsoft Office news, tips and help since 1996. Don't miss our famous free newsletter.