Share via

How quickly toggle smart quotes in Word 2010?

Anonymous
2013-07-02T04:13:34+00:00

I'm working on a long technical document that contains numerous displays of computer code. In running text, I want my quotation marks to be curly, which means that Word's "smart quotes" autoformatting-as-I-type feature is one I want on. But in code displays, curly quotes are incorrect, so in these cases, I want smart-quotes-as-I-type disabled. Is there a fast way to toggle this setting? Or is there a way I can tie it to the paragraph style I'm in? (I use a distinct style for code displays.)

Currently, to toggle the setting, I have to click File>Options>Proofing>AutoCorrect Options...>"Straight quotes" with "smart quotes">OK>OK, which is seven mouse clicks. Toggling it back is another seven mouse clicks. Isn't there a faster way? A keyhboard shortcut to do the toggling or a toolbar button that would toggle it with a single click would be great. Having the setting depend on the paragraph style I was in would be even better.

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

7 answers

Sort by: Most helpful
  1. Suzanne S Barnhill 277.1K Reputation points MVP Volunteer Moderator
    2013-07-02T04:48:32+00:00

    In this situation, it may be more efficient just to Undo (Ctrl+Z) the AutoFormat when it occurs unwanted. Or, if you have more quotation marks that should be straight than should be curly, you can use Word's built-in keyboard shortcuts to produce the "curly" quotes.

    Ctrl+', ' = closing single quote, apostrophe

    Ctrl+', " = closing double quote

    Ctrl+, = opening single quote

    Ctrl+`, " = opening double quote

    7 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2013-07-03T06:09:00+00:00

    If you only want to toggle the option and ignore existing formatting then you don't need two macros. A single macro with the line:

    Options.AutoFormatAsYouTypeReplaceQuotes = Not Options.AutoFormatAsYouTypeReplaceQuotes

    will do the job

    3 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2013-07-02T05:06:35+00:00

    The following macro will toggle the selected text from straight quotes to smart quotes or vice versa. http://www.gmayor.com/installing_macro.htm   

    Sub ReplaceQuotes()

    Dim vFindText As Variant

    Dim vReplText As Variant

    Dim sFormat As Boolean

    Dim sQuotes As String

    Dim oRng As Range

    Dim oSearch As Range

    Dim i As Long

        Set oRng = Selection.Range

        sQuotes = MsgBox("Click 'Yes' to convert smart quotes to straight quotes." & vbCr & _

                         "Click 'No' to convert straight quotes to smart quotes.", _

                         vbYesNo, "Convert quotes")

        sFormat = Options.AutoFormatAsYouTypeReplaceQuotes

        If sQuotes = vbYes Then

            vFindText = Array(Chr(147), Chr(148), Chr(145), Chr(146))

            vReplText = Array(Chr(34), Chr(34), Chr(39), Chr(39))

            Options.AutoFormatAsYouTypeReplaceQuotes = False

            For i = LBound(vFindText) To UBound(vFindText)

                Set oSearch = oRng

                With oSearch.Find

                    Do While .Execute(vFindText(i))

                        oSearch.Text = vReplText(i)

                        oSearch.Collapse wdCollapseEnd

                    Loop

                End With

            Next i

        Else

            Options.AutoFormatReplaceQuotes = True

            oRng.AutoFormat

        End If

        Options.AutoFormatAsYouTypeReplaceQuotes = sFormat

        oRng.Select

    End Sub

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2013-07-02T06:07:05+00:00

    My workaround is to create a separate style for code.

    Since I started programming on a "green screen" I like to recreate that look:

    • font Courier New
    • background 10 % grey
    • black border
    • keep lines together
    • keep with next

    This way, my code is visually distinct. Courier uses straight quotes only. Courier is fixed pitch so it is easy to use space characters to vertically align indented text

    Here is an example of the style I use

    https://skydrive.live.com/redir?resid=E9A78C332557256F!326&authkey=!AH7suwHF2erdPQg

    0 comments No comments
  5. Anonymous
    2013-07-02T05:24:29+00:00

    Thanks to Suzanne and Graham for your suggestions, but the simplest, most straightforward solution I've seen came from my posting of the same question at SuperUser. Like Graham's solution, it involves a pair of macros to turn smart quotes on and off, but unlike Graham's, it's a simple toggle of the setting; it doesn't modify any existing text.

    Thanks for your help.

    0 comments No comments