Skip footer while spell checking

F

Frederick Lorca

I have a macro that runs an automatic document spell check at the end. The
following line of code executes spell check:

ActiveDocument.CheckGrammar

I'd like for spell check to skip the document's footer(s). Is there a way
to do this?


Frederick Lorca
 
S

Shauna Kelly

Hi Frederick

ActiveDocument.CheckGrammar doesn't check the spelling. You need
ActiveDocument.CheckSpelling for that.

If you have not yet put text into the footer, you could prevent spell
checking by turning off proofing for the Footer style, and then make sure
that you use the Footer style for text in the footer:
ActiveDocument.Styles(wdStyleFooter).NoProofing = True

If you've already put text in the footer, you may be better off applying the
setting to the text itself:
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.NoProofing =
True

Remember there are up to three footers for each section, so you'll have to
cycle through them all to be sure.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top