6

It would help if there is a way to toggle the underlining on and off programmatically, assigning the command to a button to enable me to toggle with a single click.

It is a pain to go through the menus every time I want to do it currently.

How do I do this?

1
  • 1
    This is not a duplicate. "MS word: a macro to turn ON/OFF some proofing settings" asks for toggling spelling and grammar highlighting at the same time. This question is limited to spelling only. Oct 31, 2017 at 9:27

1 Answer 1

5

Two macros

The solution is to create two macros. One is to turn Spelling and Grammar as you type on, and the other is to turn it off.

In Microsoft software, you are able to record a sequence of actions and assign them to a button or keyboard shortcut

Follow these steps precisely to create the ones specific to this solution.

Macro 1: Spelling off

  1. Click View > Macros > Record macro

  2. Type "spelling_off" into the Macro name field (Spaces aren't permitted so use underscore _ character) and click the hammer button.

  3. Click 'Normal.NewMacros.spelling_off' and then the 'Add >>' button

  4. Click 'Modify...' and choose a graphic and click OK. (I choose the red square)

  5. Click OK in the Word Options screen.

  6. Click Review > Language > Language preferences > Proofing

  7. Uncheck 'Check spelling as you type'

  8. Uncheck 'Mark grammar as you type'

  9. Click OK

  10. Click View > Macros > Stop Recording

The macro code will look like this:

Sub spelling_off()
'
' spelling_off Macro
'
'
    Options.CheckGrammarAsYouType = False

    Options.CheckSpellingAsYouType = False

End Sub

Macro 2: Spelling on

  1. Click View > Macros > Record macro

  2. Type "spelling_on" into the Macro name field and click the MC Hammer button.

  3. Click 'Normal.NewMacros.spelling_on' and then the 'Add >>' button

  4. Click 'Modify...' and choose a graphic and click OK. (I choose the green square)

  5. Click OK in the Word Options screen.

  6. Click Review > Language > Language preferences > Proofing

  7. Check 'Check spelling as you type'

  8. Check 'Mark grammar as you type'

  9. Click OK

  10. Click View > Macros > Stop Recording

The macro code will look like this:

Sub spelling_on()
'
' spelling_on Macro
'
'
    Options.CheckGrammarAsYouType = True

    Options.CheckSpellingAsYouType = True

End Sub

...and that's it!

Where do the buttons appear?

The buttons appear in the top left hand corner of Microsoft Word.

Important note

After clicking a button, you will need to click anywhere on the document for the underlining to appear or disappear, and it's due to a bug in Microsoft Word, so you and I are unable to do anything about it. (unless you work for Microsoft of course!)

Not the answer you're looking for? Browse other questions tagged .