Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Overlining Characters.

Overlining Characters

Written by Allen Wyatt (last updated April 21, 2021)
This tip applies to Word 2007, 2010, 2013, and 2016


2

It is not uncommon to underline characters in your documents. This is typically done for some sort of emphasis. Overlining characters, however, is a bit trickier. Normally you use overlining for documents about electronics, where an overline indicates that the signal line is "active low."

There are many ways you can overline your characters, including searching for special fonts that include the overlines (such as the public-domain SPAtlantis font) or using the Equation Editor (the Underbar and Overbar templates are quite helpful). These solutions, however, can lead to additional problems. For instance, using a special font means that the actual characters used won't match the characters used in the rest of your document, and if you send the document to someone else, you need to make sure you embed the font or provide the font to the other person separately.

The best solution we have found is to use special field commands supplied with Word. For instance, if you wanted to use an overline on the W character, you could do the following:

  1. Position the insertion point where you want the overlined character to appear.
  2. Press Ctrl+F9 to insert field braces.
  3. Type EQ \x \to(W).
  4. Delete the extra spaces around what you typed (between the characters and the field braces).
  5. Press Shift+F9 to show the results of the field code.

To change the character displayed, simply change the W in the field to a different character. A similar approach is to use the overline character and use a field to position it "on top of" another character. You can do this by following these steps:

  1. Position the insertion point where you want the overlined character to appear.
  2. Press Ctrl+F9 to insert field braces.
  3. Type EQ \o(W,).
  4. Position the insertion point between the comma and the closing parenthesis
  5. Hold down the Alt key as you use the numeric keypad to type 0175. This inserts an overscore character.
  6. Delete any extra spaces appearing in the field.
  7. Press Shift+F9 to show the results of the field code.

Depending on the fonts you are using, either of the foregoing may result in overlines that are a bit too long for your liking. If you want an overline that is more closely related to the size of the character you are using, try these steps (again using a field):

  1. Position the insertion point where you want the overlined character to appear.
  2. Press Ctrl+F9 to insert field braces.
  3. Type EQ \o(W,).
  4. Between the comma and the closing parenthesis, press Ctrl+F9 again. This places a second field, this one within the first field.
  5. Type EQ \s\up10(_).
  6. Delete any extra spaces within the two field braces.
  7. Press Shift+F9 twice to show the results of the field code.

Regardless of which method you use, you can select the field and assign it to an AutoText entry so that it appears automatically when you type the entry.

You can also use a macro, if you prefer, to add the proper field codes. The following example macro prompts you for the character you want overlined, and then creates the field to overline it. The field used in the macro is the one you created manually in the last set of steps.

Sub Overline()
     Dim sChar As String

     sChar = InputBox("Enter character to overline", "Overline")

    Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
        PreserveFormatting:=False
    Selection.MoveLeft Unit:=wdCharacter, Count:=1
    Selection.Delete Unit:=wdCharacter, Count:=2
    Selection.TypeText Text:="EQ \o(" + sChar + ",)"
    Selection.MoveLeft Unit:=wdCharacter, Count:=1
    Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
        PreserveFormatting:=False
    Selection.MoveLeft Unit:=wdCharacter, Count:=1
    Selection.Delete Unit:=wdCharacter, Count:=2
    Selection.TypeText Text:="EQ \s\up10(_)"
    Selection.Fields.ToggleShowCodes
    Selection.MoveLeft Unit:=wdCharacter, Count:=2
    Selection.Fields.ToggleShowCodes
End Sub

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (4314) applies to Microsoft Word 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Word here: Overlining Characters.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Getting Rid of 'Mail To:' in E-mail Links

If you convert e-mail addresses to hyperlinks, you could end up with some 'mailto:' verbiage at the beginning of the ...

Discover More

Inserting a Cross-Reference to Text

Cross-referencing is a great feature of Word that allows you to add references to text in various places of your ...

Discover More

Rounding to a Half Hour and Formatting the Display

Excel is quite flexible in how it allows you to format and display times. However, some formatting and displaying can ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Easily Changing Username and Initials

Word uses usernames and initials to mark changes made while Track Changes is turned on. If you want to change those ...

Discover More

Not Selecting Images when Selecting Text

When selecting text in a document that contains images, it is important to understand the relationship of those images ...

Discover More

Selecting the Entire Document with the Mouse

Want a quick way to select your entire document without taking your hand off the mouse? Try clicking away using the ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is nine minus 5?

2018-06-20 08:58:06

Bruce

Thanks, Allen, this is the second time in as many months that a web search for a solution to my peculiar Word problem led me to your tips and a well-explained answer. I appreciate all you do to help Word users and I'm subscribing to your newsletter.


2018-01-13 09:48:11

Christopher Tribe

You can also use the combining diacritic marks included in Unicode fonts. Type your base letter (e.g., W), go to Insert—Symbol—More symbols, and then in the Character code box type 0305 (for a combining overline) or 0304 (for a shorter combining macron). If you use this often, you could assign the combining diacritic mark to a shortcut key of your choice by clicking on the Shortcut Key button at the bottom of the Symbol dialog box and assigning a key combination (e.g., Alt-w). Then you just need to type w Alt-w to get w̅, or x Alt-w to get x̅ .


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.