Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Replacing Quoted Text with Italics.

Replacing Quoted Text with Italics

Written by Allen Wyatt (last updated June 25, 2018)
This tip applies to Word 97, 2000, 2002, and 2003


In many word processors, an author may call out material with quote marks. For instance, the first time a term is introduced, the author may enclose the term in quote marks. In Word, however, you can call out information with italics. Manually changing quoted material to italics can be very time consuming.

The following macro, QuotesToItalics, checks the current paragraph for quoted material. If there is any, it deletes the quotes and changes the text between the quotes to italics. If the quote marks are unbalanced (there is an opening or closing quote mark with no corresponding closing or opening quote mark), then the quote mark is ignored and no changes are made. The macro works with either regular quotes or smart quotes.

Sub QuotesToItalic()
    Dim Redo As Boolean
    Dim Ptr As Integer
    Dim Ptr1 As Integer
    Dim P As String
    Dim P1 As String

    If Selection.ExtendMode Then Exit Sub
    Redo = True
    While Redo
        Selection.StartOf Unit:=wdParagraph, Extend:=wdMove
        Selection.MoveEnd Unit:=wdParagraph
        P = Selection.Text
        Ptr = InStr(P, Chr(34))
        If Ptr = 0 Then Ptr = InStr(P, Chr(147))
        If Ptr > 0 Then
            Selection.MoveLeft Unit:=wdCharacter, Extend:=wdMove
            Selection.MoveRight Unit:=wdCharacter, Count:=Ptr
            Selection.MoveEnd Unit:=wdParagraph
            P1 = Selection.Text
            Ptr1 = InStr(P1, Chr(34))
            If Ptr1 = 0 Then
                Ptr1 = InStr(P1, Chr(148))
                EndChar = Chr(148)
            Else
                EndChar = Chr(34)
            End If
            If Ptr1 > 0 Then
                Selection.MoveLeft Unit:=wdCharacter, Count:=2, _
                  Extend:=wdMove
                Selection.Delete Unit:=wdCharacter
                Selection.MoveRight Unit:=wdCharacter, _
                  Count:=Ptr1 - 1, Extend:=wdExtend
                Selection.Font.Italic = True
                Selection.MoveRight Unit:=wdCharacter, Extend:=wdMove
                Selection.Delete Unit:=wdCharacter
            Else
                Selection.MoveRight Unit:=wdCharacter, Extend:=wdMove
                Redo = 0
            End If
        Else
            Selection.MoveRight Unit:=wdCharacter, Extend:=wdMove
            Redo = 0
        End If
    Wend
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 (264) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Replacing Quoted Text with Italics.

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

Repeating Table Rows with Manual Page Breaks

Need to make sure part of a table is on one page and part on another? The way to do so is not to use manual page breaks, ...

Discover More

Making Macros Available without Using the Normal Template

If you save your macros in your Normal template, they'll be available whenever you are using Word. What if you don't want ...

Discover More

Combining Worksheets from Many Workbooks

Do you need to pull a particular worksheet out of a group of workbooks and combine those worksheets into a different ...

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 (menu)

Smushing Text Together

Word gives you control over how your text appears on the page. This includes adjusting how close letters are to each ...

Discover More

Changing Font Size Using a Shortcut Key

When you need to change the font size of a text selection, using the shortcut described in this tip is a great technique. ...

Discover More

Changing the Height of a Font

Scaling the width of a font is easy to do with Word's formatting capabilities. Scaling the height of the fonts is not so ...

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 1 + 1?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon 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.