Toggling AutoCorrect Settings

by Allen Wyatt
(last updated January 9, 2015)

Word includes a great feature that allows you to automatically streamline what you type. This feature, called AutoCorrect, automatically makes changes to what you type to fit specific rules that you select. For instance, you can cause Word to capitalize the first word of your sentences or automatically capitalize the names of days. (You can view your AutoCorrect settings by selecting AutoCorrect from the Tools menu.)

There are times when AutoCorrect can get in the way of what you are typing. This is particularly true if you are typing technical material. There is no "master switch" that allows you to turn off the AutoCorrect feature, however. Instead, you must display the dialog box and turn off each check box, in turn. When you later want it back on, you must go through the same process again.

The following macro can quickly turn off your AutoCorrect settings. When you run the macro a second time, the AutoCorrect settings are set back to their original values. The macro is designed to be added to a toolbar, and then you can click on the tool to change AutoCorrect.

Sub ToggleAC()
    Dim State As String
    Dim ACVal As Integer
    Dim VarPass As Variant
    Dim VarNum As Integer

    VarNum = 0
    For Each VarPass In ActiveDocument.Variables
        If VarPass.Name = "ACState" Then VarNum = VarPass.Index
    Next VarPass

    If VarNum <> 0 Then
        State = ActiveDocument.Variables.Item(VarNum).Value
        ACVal = Val(Mid$(State$, 1, 1))
        If ACVal <> 0 Then AutoCorrect.CorrectInitialCaps = True
        ACVal = Val(Mid$(State$, 2, 1))
        If ACVal <> 0 Then AutoCorrect.CorrectSentenceCaps = True
        ACVal = Val(Mid$(State$, 3, 1))
        If ACVal <> 0 Then AutoCorrect.CorrectDays = True
        ACVal = Val(Mid$(State$, 4, 1))
        If ACVal <> 0 Then AutoCorrect.CorrectCapsLock = True
        ACVal = Val(Mid$(State$, 5, 1))
        If ACVal <> 0 Then AutoCorrect.ReplaceText = True
        ACVal = Val(Mid$(State$, 6, 1))
        If ACVal <> 0 Then Options.AutoFormatAsYouTypeReplaceQuotes = True
        ActiveDocument.Variables.Item(VarNum).Delete
    Else
        State = ""
        State = State & Mid(Str(Abs(AutoCorrect.CorrectInitialCaps)), 2)
        State = State & Mid(Str(Abs(AutoCorrect.CorrectSentenceCaps)), 2)
        State = State & Mid(Str(Abs(AutoCorrect.CorrectDays)), 2)
        State = State & Mid(Str(Abs(AutoCorrect.CorrectCapsLock)), 2)
        State = State & Mid(Str(Abs(AutoCorrect.ReplaceText)), 2)
        State = State & Mid(Str(Abs(Options.AutoFormatAsYouTypeReplaceQuotes)), 2)
        ActiveDocument.Variables.Add "ACState", State
        With AutoCorrect
            .CorrectInitialCaps = False
            .CorrectSentenceCaps = False
            .CorrectDays = False
            .CorrectCapsLock = False
            .ReplaceText = False
        End With
        Options.AutoFormatAsYouTypeReplaceQuotes = True
    End If
End Sub

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1738) applies to Microsoft Word 97, 2000, 2002, and 2003.

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

Renaming a Macro

Want to give your macros a different name than they currently use? It's easy to do using the VBA Editor as described here.

Discover More

Limiting Who Can Delete Data

Excel allows you to protect your worksheet data in several different ways. Unfortunately, it doesn't allow you to protect the ...

Discover More

Quickly Inserting a New Worksheet

Want a quick way to insert a worksheet? There's nothing faster than using the handy shortcut.

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

MORE WORDTIPS (MENU)

Using AutoText and AutoCorrect Effectively

AutoText and AutoCorrect are closely related tools that can help you improve the productivity of your typing. This tip ...

Discover More

Automatically Capitalizing Day Names

Type the name of any of the seven days into your document, and Word automatically makes sure it is capitalized. This is done ...

Discover More

Managing the AutoCorrect List

If you need to delete all the entries in your AutoCorrect list, the easiest way to do so is with a macro. This tip describes ...

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 for this tip:

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}] in your comment text. You’ll be prompted to upload your image when you submit the comment. 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 eight more than 7?

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


Newest Tips
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.

Links and Sharing
Share