MS Word: Ein Makro zum Ein- und Ausschalten einiger Korrektureinstellungen

MS Word: Ein Makro zum Ein- und Ausschalten einiger Korrektureinstellungen

Mit welchem ​​Makro lassen sich einige Proofeinstellungen ein- und ausschalten? (Leider werden die Einstellungsänderungen bei der Makroaufzeichnung nicht aufgezeichnet.)

Ich suche nach einer Möglichkeit, zwei Proofeinstellungen (gleichzeitig) ein- und auszuschalten:

  • Überprüfen Sie die Rechtschreibung während der Eingabe
  • Markieren Sie Grammatikfehler während der Eingabe

Antwort1

Application.Options.CheckGrammarAsYouType & .CheckSpellingAsYouType ist das, wonach Sie suchen.

Beispiel:

Sub GrammarSpellingOn()
    Application.Options.CheckGrammarAsYouType = True
    Application.Options.CheckSpellingAsYouType = True
End Sub

Sub GrammarSpellingOff()
    Application.Options.CheckGrammarAsYouType = False
    Application.Options.CheckSpellingAsYouType = False
End Sub

So schalten Sie es mit demselben Makro ein/aus, wobei ein Popup die vorgenommene Änderung angibt:

Sub GrammarSpellingOnOff()
    If Application.Options.CheckGrammarAsYouType = True Or Application.Options.CheckSpellingAsYouType = True Then
        Application.Options.CheckGrammarAsYouType = False
        Application.Options.CheckSpellingAsYouType = False
        Call MsgBox("Grammar & Spell Checking turned OFF")
    Else
        Application.Options.CheckGrammarAsYouType = True
        Application.Options.CheckSpellingAsYouType = True
        Call MsgBox("Grammar & Spell Checking turned ON")
    End If
    Application.ScreenRefresh 'refresh to add/remove spellchecker underlines
End Sub

Antwort2

Ich habe es also etwas anders eingerichtet. Ich verwende es hauptsächlich, wenn ich Präsentationen schreibe, die Code enthalten. Ich habe die Makros Tasten zugewiesen und hier sind beide Makros:

Dadurch werden alle Korrekturen ignoriert und die lästigen Markierungen aus Word entfernt.

    Sub CodeFont()
'
' CodeFont Macro
' Change font to differentiate code
'
    Selection.Font.Name = "Consolas"
    Selection.Font.Size = 11
    Selection.Font.ColorIndex = wdBlue
    Selection.NoProofing = True
End Sub

Und wenn ich wieder zur "normalen" Eingabe zurückkehren möchte

Sub Normal()
'
' Normal Macro
'
'
    Selection.Font.Name = "Times New Roman"
    Selection.Font.Size = 12
    Selection.Font.ColorIndex = wdBlack
    Selection.NoProofing = False
End Sub

verwandte Informationen