Prefix and Suffix characters in Word including styles


Office for Mere Mortals
Your beginners guide to the secrets of Microsoft Office
Invalid email address
Tips and help for Word, Excel, PowerPoint and Outlook from Microsoft Office experts.  Give it a try. You can unsubscribe at any time.  Office for Mere Mortals has been running for over 20 years, we've never, ever revealed or sold subscriber details.  Privacy policy

Word styles can be tweaked to insert fixed characters before the text.  Prefix anything in a certain style with your choice of characters or words. Suffixing, or adding after some text, is a lot harder.

Word’s prefix and suffix support is poor and very limited.  This article shows what’s possible and workarounds for this strange omission.

Why prefix?

There are various situations where you might want to use a style to set words before a paragraph.  For example, a simple Q & A with pairs of paragraphs like this:

prefix and suffix characters in word including styles microsoft word 34322 - Prefix and Suffix characters in Word including styles

With the preceding text in the style, it’s very easy to change the look.  Use different words or abbreviation (Query, Ask, Prompt) or separator ( : – —…).

Yes, you could use Replace but that only works if the find text is only in that starting location, not anywhere else in the document.

Suffixes or text following isn’t supported by Word but you can fake it, almost.  We’ll show some examples below.

  • Adding … after an item
  • ‘Read More’ or ‘click here’ text in links at end of excerpt.
  • Whether a list (bullet or numbered) should have a fullstop/period at the end of each item. (this provokes some very heated opinions!)

Prefix/Suffix support would be great for special items like product codes, SKUs, code samples etc.  With proper prefix/suffix support in character styles it would be possible to show those elements in a consistent and easily changeable way.  (SKU1234) could become [SKU1234]  {SKU1234} or just SKU1234 by just changing the style.

CSS prefix/suffix

Web designers know that prefix/suffix is easy with Cascading Style Sheets CSS used in most web sites.  There are Pseudo-elements called :before and :after combined with the ‘content’ property that can add whatever you like as prefix or suffix.

ol li:before
{   content:"Question "; }

That CSS code adds the text ‘Question ’ to the start of each item in an numbered list.

If it’s possible and easy in a browser, surely it’s available in Microsoft Word?  Sorry, not so much.

Prefix

There’s no direct support for prefixes in Word but it’s fairly easy to fake for paragraphs.  In short, use multi-level numbering but without the numbers!

As you may know, Home | Paragraph | Multi-Level list can add text before numbers like Article, Heading, Section etc.

prefix and suffix characters in word including styles microsoft word 34323 - Prefix and Suffix characters in Word including styles

Make a new Multilevel list.

Number style for this level choose None.

  • Number style for this level – type in the prefix text you want.

prefix and suffix characters in word including styles microsoft word 34324 - Prefix and Suffix characters in Word including styles

Answer could be a separate multilevel list style but it’s probably easier to make it the second level of the same list style. If you wish, change the Aligned and Text indent so it’s aligned with Question, instead of the default indenting.

prefix and suffix characters in word including styles microsoft word 34325 - Prefix and Suffix characters in Word including styles

That works for paragraphs but not for character styles where, arguably, prefix/suffix support is needed even more. There’s a workaround for that, which we’ll explain below for suffixes.

Suffix

Adding fixed suffix text is possible but a lot harder. Harder than it should be.

Here’s an example of where a style-based suffix would be useful. The label (Bold, Italic etc.) can have different suffixes depending on preference (space, colon, dash, em-dash).

prefix and suffix characters in word including styles microsoft word 34326 - Prefix and Suffix characters in Word including styles

Ideally the label text could have a Character Style with a suffix setup in the style.  Since Microsoft hasn’t given us that, we have to look for workarounds.

If the suffix character or word is only in the suffix and nowhere else in the document, a simple Replace is enough.

But if the suffix is (or might be) in other parts of the document, a more complex Replace is necessary.

End of Paragraph only

One possibility is to search for the ending text plus the end of paragraph marker (^p in a find or replace).  That ensures you only replace text at the end of a paragraph.

This example replaces ellipsis … with a colon but only if at the end of a paragraph.

prefix and suffix characters in word including styles microsoft word 34327 - Prefix and Suffix characters in Word including styles

Limit by style

Another way to limit a find/replace is by style.

For this to work, you need to apply a special style to the paragraphs or phrases that need a special suffix.  Any replace can be limited to text just in that style. Choose the find and replace style using Format | Style.

This example only applies to text with the style ‘Code char’, the square closing bracket is replaced with a curly closing bracket.  E.g.   [Screen Cap]  becomes [Screen Cap}  .

prefix and suffix characters in word including styles microsoft word 34328 - Prefix and Suffix characters in Word including styles

VITAL!  This assumes that the prefix/suffix character is ONLY used in those two positions, not in the main text formatted with that style.

That’s also a way to workaround prefix/suffix in a character style.

Adding text to character style

If there’s no prefix/suffix text already present, there’s a way to insert text before or after a character style.

Use Replace with one of the lesser used find settings: Find whole words only.  Combine that with searching in a chosen style only.

Replace with uses another lesser known option:  Find What Text ^&  which inserts the result of the find into the replace box. If you want a prefix, add the text before e.g

Command:^&

For a suffix put it after:

^& —
prefix and suffix characters in word including styles microsoft word 34330 - Prefix and Suffix characters in Word including stylesIf you prefer Wildcards / Regular Expressions, try this.

(<[A-Za-z]@{1,99})

Or

(<*>)

Finds whole words (letters only) or entire words in the chosen style only.

prefix and suffix characters in word including styles microsoft word 34331 - Prefix and Suffix characters in Word including styles

This works for single words only, as in our example above.

Finding multiple words takes more complex wildcards that find the word and extend to the start of the following text (in this case ‘Ctrl’).

Wish List

If Microsoft wanted to improve Word styles, they could start by looking at some of the features in modern CSS like pseudo elements  :before :after :first-letter and :first-line.  Add to that something not in CSS  :first-para

subs profile e1563205311409 - Prefix and Suffix characters in Word including styles
Latest news & secrets of Microsoft Office

Microsoft Office experts give you tips and help for Word, Excel, PowerPoint and Outlook.

Give it a try. You can unsubscribe at any time.  Office Watch has been running for over 20 years, we've never, ever revealed or sold subscriber details.  Privacy policy
Invalid email address