locked
excluding VBA codes from grammar & Spell checker in word 2013 RRS feed

  • Question

  • hi Guys

    i am learning VBA & i write my notes & my exercises in a word document.

    the problem is Grammar & spell checker shows VBA codes as errors.

    i don't want to completely disable checker. is there any method or Add-on so that we introduce Correct VBA codes as correct sentences to word 2013 so that it doesn't show them as errors ?

    thanks in advanced

    Monday, November 3, 2014 9:08 AM

Answers

  • Simply define and apply a paragraph Style to your code and, for that Style, specify 'do not check spelling or grammar' option for the Language.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by john.s2011 Tuesday, November 4, 2014 7:09 AM
    • Unmarked as answer by john.s2011 Tuesday, November 4, 2014 2:05 PM
    • Marked as answer by john.s2011 Wednesday, November 5, 2014 10:44 AM
    Monday, November 3, 2014 9:22 AM
  • i tested it but i noticed an strange behavior. it sometimes works but sometime doesn't. or sometime partially works.

    for example i have defined a box as a border around the selected Area. this applies but although i have selected "do not check spelling or grammar" , system again shows spelling & grammar errors as you see in the screenshot. it's seen even after i reapply style. any further help please?

    Your screenshots have far too little resolution to see anything meaningful. I cannot see what Style you're applying the attributes to, or how you're using that Style. If you're applying the Style to text that's already in the document, you may need to run the spell-checker to clear the 'error' underlining that was already there.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by john.s2011 Wednesday, November 5, 2014 10:44 AM
    Wednesday, November 5, 2014 8:19 AM
  • As I said, simply applying the Style to existing content won't automatically delete the 'spelling error' underlines. Any new text you add to that Style, though (e.g. by formatting new paragraph with it, then adding the text), won't get the 'spelling error' underlines.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by john.s2011 Friday, November 7, 2014 4:51 AM
    Thursday, November 6, 2014 9:13 PM

All replies

  • Simply define and apply a paragraph Style to your code and, for that Style, specify 'do not check spelling or grammar' option for the Language.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by john.s2011 Tuesday, November 4, 2014 7:09 AM
    • Unmarked as answer by john.s2011 Tuesday, November 4, 2014 2:05 PM
    • Marked as answer by john.s2011 Wednesday, November 5, 2014 10:44 AM
    Monday, November 3, 2014 9:22 AM
  • Simply define and apply a paragraph Style to your code and, for that Style, specify 'do not check spelling or grammar' option for the Language.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Hi Paul

    very useful

    thank you very much. i tested it but i noticed an strange behavior. it sometimes works but sometime doesn't. or sometime partially works.

    for example i have defined a box as a border around the selected Area. this applies but although i have selected "do not check spelling or grammar" , system again shows spelling & grammar errors as you see in the screenshot. it's seen even after i reapply style. any further help please?


    any idea please?
    • Edited by john.s2011 Tuesday, November 4, 2014 8:35 AM
    Tuesday, November 4, 2014 7:09 AM
  • i tested it but i noticed an strange behavior. it sometimes works but sometime doesn't. or sometime partially works.

    for example i have defined a box as a border around the selected Area. this applies but although i have selected "do not check spelling or grammar" , system again shows spelling & grammar errors as you see in the screenshot. it's seen even after i reapply style. any further help please?

    Your screenshots have far too little resolution to see anything meaningful. I cannot see what Style you're applying the attributes to, or how you're using that Style. If you're applying the Style to text that's already in the document, you may need to run the spell-checker to clear the 'error' underlining that was already there.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by john.s2011 Wednesday, November 5, 2014 10:44 AM
    Wednesday, November 5, 2014 8:19 AM
  • i tested it but i noticed an strange behavior. it sometimes works but sometime doesn't. or sometime partially works.

    for example i have defined a box as a border around the selected Area. this applies but although i have selected "do not check spelling or grammar" , system again shows spelling & grammar errors as you see in the screenshot. it's seen even after i reapply style. any further help please?

    Your screenshots have far too little resolution to see anything meaningful. I cannot see what Style you're applying the attributes to, or how you're using that Style. If you're applying the Style to text that's already in the document, you may need to run the spell-checker to clear the 'error' underlining that was already there.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    i have created the "NOGrammarSpellCheck" Style correctly.

    yes i had written some VBA codes in my doc, then i created my "NoGrammarCheck" Style & Applied it on the selected Exiting codes. but again errors are shown. i noticed that when i again click on my style to apply, know errors disappear.

    so i found that if codes exit before, we must apply the "NoGrammarCheck" Style Twice so that it completely be applied.

    but if we Apply the style on a blank area in word doc & then paste our VBA codes in that Area, now everything is ok & no grammar or spell check is shown.

    am i correct ?

    Wednesday, November 5, 2014 10:48 AM
  • As I said, simply applying the Style to existing content won't automatically delete the 'spelling error' underlines. Any new text you add to that Style, though (e.g. by formatting new paragraph with it, then adding the text), won't get the 'spelling error' underlines.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by john.s2011 Friday, November 7, 2014 4:51 AM
    Thursday, November 6, 2014 9:13 PM