MS 워드: 일부 교정 설정을 ON/OFF하는 매크로

MS 워드: 일부 교정 설정을 ON/OFF하는 매크로

일부 교정 설정을 켜거나 끌 수 있는 매크로는 무엇입니까? (아쉽게도 매크로 기록은 설정 변경을 기록하지 않습니다)

2가지 교정 설정을 동시에 켜거나 끌 수 있는 방법을 찾고 있습니다.

  • 입력할 때 맞춤법을 확인하세요.
  • 입력할 때 문법 오류 표시

답변1

Application.Options.CheckGrammarAsYouType & .CheckSpellingAsYouType이 당신이 찾고 있는 것입니다.

예:

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

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

동일한 매크로를 사용하여 변경이 완료되었음을 알리는 팝업을 사용하여 ON/OFF하려면:

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

답변2

그래서 조금 다르게 설정해봤습니다. 저는 코드가 포함된 프레젠테이션을 작성할 때 주로 사용합니다. 매크로를 키에 할당했는데 여기에 두 매크로가 모두 있습니다.

이렇게 하면 모든 교정이 무시되므로 Word에서 성가신 마커를 제거합니다.

    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

그리고 "일반" 입력으로 돌아가고 싶을 때

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

관련 정보