Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, 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 Parentheses.

Adding Parentheses

Written by Allen Wyatt (last updated September 20, 2022)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


9

Normally, you add parentheses around your parenthetical remarks as you type your text. There may be times, however, when you want to add the parentheses at a later time. For instance, while editing your document you may select some text and then want parentheses added around the selected text. The following macro, AddParens, can be used to add the desired parentheses:

Sub AddParens()
    If Len(Selection.Range) > 0 Then
        Selection.InsertBefore "("
        Selection.InsertAfter ")"
    Else
        MsgBox "No text was selected!"
    End If
End Sub

The macro uses the InsertBefore and InsertAfter methods to add the appropriate parenthesis before and after the selected text.

To use the macro, assign it to a shortcut key or to a toolbar button. You then select the target text and invoke the macro. The desired parentheses are added to the text. (If you don't select any text before invoking the macro, you'll see a message box to that effect.)

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 (11920) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Adding Parentheses.

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

Resetting All Shortcut Keys

At some point you might want to wipe out all the custom shortcut keys you've created in Word. This is easy to do by ...

Discover More

Modifying the Backup Copy File Name

Backup files, created automatically by Word, have the filename extension WBK and start with the words "Backup of." If you ...

Discover More

Displaying Nonprinting Characters

Nonprinting characters are a great boon when you are editing a document. Turn them on and you can easily see what ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (ribbon)

Setting Paste Default to Use Target Formatting

There are several ways that Word can handle formatting when you paste information in a document. This tip shows you how ...

Discover More

Inserting a Bullet

Need to place a bullet in the middle of a sentence? There are a couple of easy ways you can do this, as described in this ...

Discover More

Deleting Freezes Computer

Sometimes a strange object or text may appear in your document, as happened to Sharon. To complicate the situation, her ...

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 two less than 9?

2022-09-20 12:44:07

Austin

And note that this macro can be modified to enclose selected text between quotation marks, brackets, or any other paired characters.


2020-08-08 16:21:52

James

How can we apply this for multiple words selected in a document? It is only applying to a last selected word.
Please help.


2020-08-08 15:40:03

James

How can we apply this for multiple words selected in a document? It is only applying to a last selected word.
Please help.


2020-06-17 20:12:17

Larry Schwartz

My thanks also. I have over 400 of these paragraphs.


2020-06-15 08:10:13

Martin Barry

Fabulous! Thanks so much for your help.


2020-06-14 04:23:06

Ken Endacott

The following modified macro will avoid including a paragraph mark and/or a space before the right parenthesis.

Sub AddParens()
If Right(Selection.Range.Text, 1) = Chr(13) Then _
Selection.MoveEnd Unit:=wdCharacter, Count:=-1

If Right(Selection.Range.Text, 1) = Chr(32) Then _
Selection.MoveEnd Unit:=wdCharacter, Count:=-1

If Len(Selection.Range) > 0 Then
Selection.InsertBefore "("
Selection.InsertAfter ")"
Else
MsgBox "No text was selected!"
End If
End Sub


2020-06-13 23:52:22

Larry Schwartz

The parenthesis macro came at exactly the time I need it. I’m working with an existing screenplay document in which parenthetical comments are a major component. For these, I need to be able to select a paragraph and then use the macro to enclose the text. However, because selecting a paragraph includes the ending paragraph character, the macro results in the text with the paragraph marker followed by the ending parenthesis, i.e., the ending parenthesis is at the start of the following paragraph. Could you suggest a change to the macro to fix this?


2020-06-12 13:25:47

Martin Barry

Same as Ben K.'s unanswered question from 2018: this Macro doesn't seem to work as it should because Word inserts a leading space before the right parenthesis. Is this a Word anomaly, and is there a way to disable it? On the face of it, the macro itself ought to yield the right result, so I can only assume this is a bit of dim-witted Microsoft behaviour. Thanks!


2018-10-19 13:29:17

Ben K.

How can this macro be modified to NOT enclose a trailing space after a word? I'd like the macro to check if the final character in the selection is a space, and if it is, put the closing parentheses to the left of the space.


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.