dcsimg
Results 1 to 3 of 3

Thread: Turn Off AutoCorrect in Custom Style

  1. #1

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    9,569

    Turn Off AutoCorrect in Custom Style

    Is it possible whenever I create a new style that Microsoft's AutoCorrect is turned off for only text that uses the style?

    To give you an idea of what I'm doing, I'm writing a manual that involves code, so I created a new style, named it code, gave it borders with the consolas font, but whenever I type in the code(in particular variable names) it wants to AutoCorrect the text.

  2. #2
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,569

    Re: Turn Off AutoCorrect in Custom Style

    I haven't gotten this to work yet, but I would think you could check for the style in the selection_change event, and disable auto-correct if necessary. Then in the worksheet_change event, you could turn it back on, something like:

    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
        With Application.AutoCorrect
                .TwoInitialCapitals = True
                .CorrectSentenceCap = True
                .CapitalizeNamesOfDays = True
                .CorrectCapsLock = True
                .ReplaceText = True
                .DisplayAutoCorrectOptions = True
        End With
    End Sub
    
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        If Target.Style = "Accent5" Then
            With Application.AutoCorrect
                .TwoInitialCapitals = False
                .CorrectSentenceCap = False
                .CapitalizeNamesOfDays = False
                .CorrectCapsLock = False
                .ReplaceText = False
                .DisplayAutoCorrectOptions = True
            End With
        End If
    End Sub

  3. #3
    PowerPoster
    Join Date
    Oct 2010
    Posts
    2,141

    Re: Turn Off AutoCorrect in Custom Style

    Assuming you mean for MS Word, take a look at the following link for direction on how to configure the Style.

    Turning off Proofing and Autocorrect in Word 2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width