
Tips.Net > WordTips Home > Formatting > Character Formatting > Overlining Characters
Summary: Want to add an overline above a character or two in your document? There are several ways you can try, as described in this tip. (This tip works with Microsoft Word 97, Word 2000, Word 2002, Word 2003, and Word 2007.)
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:
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:
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):
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
Tip #268 applies to Microsoft Word versions: 97 2000 2002 2003 2007
Step Up and Take Control! Subscribers to WordTips know just how valuable a resource it is. WordTips Premium provides twice the number of exceptional, easy-to-understand tips every week in an ad-free newsletter, as well as substantial discounts on WordTips archives and e-books.
Check out WordTips Premium today!
Learn to use styles and you discover the real power behind Word. Fast, easy, consistent document formatting and updating is within your grasp. (more information...)
Ask a Word Question
Make a Comment
Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips