Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365. 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: Adding Vertical Lines at the Sides of a Word.

Adding Vertical Lines at the Sides of a Word

Written by Allen Wyatt (last updated April 12, 2025)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365


1

Word allows you to easily add all sorts of flourishes to the text in your document. If you want to add vertical lines at the left and right of a word—perhaps for a page title—you can do so easily using any one of several different methods. One way is to use the "pipe" character before and after your word. On most keyboards the pipe, or vertical bar, is a shifted version of the \ character. Type the pipe, a few spaces, the word, the same number of spaces, and then another pipe character. You can then center the paragraph. If you are comfortable with the use of fields in a document, you could also try using the pipe character with the EQ field. Just insert a set of field braces (by pressing Ctrl+F9) and then making sure the field looks like this:
{eq \b \bc\| ( myword )}
When you collapse the field (put the insertion point within the field code and press F9) you end up with "myword" centered between the pipe characters. Another method is to simply type your word and then format the paragraph so that it has borders at the left and right sides. Follow these steps:
  1. Make sure the insertion point is within the word for which there should be vertical lines on both sides.
  2. Display the Home tab of the ribbon.
  3. Click the down-arrow next to the Borders tool in the Paragraph group and then choose Borders and Shading. Word displays the Borders and Shading dialog box. (See Figure 1.)
  4. Figure 1. The Borders and Shading dialog box.

  5. Make sure the Borders tab is selected.
  6. Use the controls in the dialog box to add the desired border to both the left and right sides of the paragraph.
  7. Click on OK.
At this point you should see the borders on both sides of the paragraph. However, they are probably too far from the text, as the paragraph extends all the way from the left margin to the right. (This means that the borders appear at the left and right margins.) Adjust the left and right indents of the paragraph so that the vertical lines move in closer to the center. You can also adjust the other settings for the paragraph formatting (like Space Before and Space After) to get the paragraph exactly where you want it. You can select the word itself and raise it or lower it in relation to the bordering lines in this manner:
  1. Select the word you want to adjust.
  2. Press Ctrl+D to display the Font dialog box.
  3. Make sure the Character Spacing tab (Word 2007) or Advanced tab (Word 2010 and later versions) is selected. (See Figure 2.)
  4. Figure 2. The Advanced tab of the Font dialog box.

  5. Using the Position drop-down list, choose either Raised or Lowered, as desired.
  6. Using the By box (to the right of the Position drop-down list) specify how far, in points, the text should be raised or lowered.
  7. Click OK.
Using the paragraph borders in this manner can require a lot of trial and error to get everything just right. If you use a table instead of a regular paragraph, the positioning is just a bit easier. Simply create a centered single-cell-table and make sure the cell is wide enough to contain the word you want. When you center the word in the table cell, you can then add borders to the left and right sides of the cell. Finally, you'll want to vertically adjust the word within the cell by following these steps:
  1. Make sure that the paragraph within the table cell is formatted so there is no space before or after.
  2. Make sure the insertion point is within the word in the cell.
  3. Display the Layout tab of the ribbon under Table Tools.
  4. In the Table group click the Properties tool. Word displays the Table Properties dialog box.
  5. Make sure the Cell tab is displayed. (See Figure 3.)
  6. Figure 3. The Cell tab of the Table Properties dialog box.

  7. In the Vertical Alignment area click Center.
  8. Click OK.
Finally, you could create the desired lines by simply drawing the vertical lines you want. This is particularly helpful if you want the lines to be "fancy" in some way—a way that can only be achieved through using the shapes available in Word. Draw two of the same lines, place your word in a text box, adjust the lines and text box so all elements are in the desired relative positions, and then select all three items and group them. This last step is particularly important since it will ensure that the relative positions of the elements don't move around later.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (6828) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Adding Vertical Lines at the Sides of a Word.

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

Spell Checking Forms

Word may be used to create protected forms that limit where the user may input data. Normally spell checking is disabled ...

Discover More

Moving a Table Column

Want to move a column in a table very easily? You can do so by using the same editing techniques you are already using.

Discover More

Changing Portions of Many Hyperlinks

If you need to modify the URL used in a large number of hyperlinks, you can do so by using a macro and a little ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 365 applications with VBA programming. Written in clear terms and understandable language, the book includes systematic tutorials and contains both intermediate and advanced content for experienced VB developers. Designed to be comprehensive, the book addresses not just one Office application, but the entire Office suite. Check out Mastering VBA for Microsoft Office 365 today!

More WordTips (ribbon)

Using the Highlighter

Need to draw attention to some text? Consider using the Highlight tool, which functions just like the highlighter pens ...

Discover More

Automatic Blank Pages at the End of a Section

If you want to have a blank page at the end of a document section, you can insert one manually or you can use the ...

Discover More

Section Breaks Changing On Their Own

Sometimes Word does things that just don't make sense. For instance, have you ever inserted a section break into your ...

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 three less than 4?

2025-04-13 13:22:37

Biddy Greene

Hi

Why can't one just look for wrong commas in numbers by looking for (e.g.)
,^#^#^#^#, (^# being "any digit") ?

Also why can't one just put in vertical lines on either side of a word by just using the vertical line key (above the slash key), like this: |word| ?

Biddy Greene.


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.