Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
change the grammar and style option that calls out
I want to know how to change the grammar and style option that calls out sentences that are more than 60 words per sentence. I want to change the grammar checking so when I run the Spelling and Grammar tool, it will flag sentences with more than 25 words, rather than 60 words. thanks, Paula -- Paula Cross |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
change the grammar and style option that calls out
Paula Cross wrote:
I want to know how to change the grammar and style option that calls out sentences that are more than 60 words per sentence. I want to change the grammar checking so when I run the Spelling and Grammar tool, it will flag sentences with more than 25 words, rather than 60 words. thanks, Paula That grammar rule can't be changed. The following macro will apply a yellow highlight to every sentence longer than 25 words (although this is Microsoft's internal definition of "word", which includes certain punctuation marks). Sub LongSentences() Const Limit = 25 ' == change this if needed Dim mySent As Range For Each mySent In ActiveDocument.Sentences If mySent.Words.Count = Limit Then MsgBox mySent.Words.Count mySent.HighlightColorIndex = wdYellow End If Next End Sub See http://www.gmayor.com/installing_macro.htm if needed. After you run the macro, use the Edit Find dialog to search for highlighted text. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
change the grammar and style option that calls out
Oops, my mistake -- take out the line that starts with "MsgBox", unless you
want to see a message pop up for every long sentence. Jay Freedman wrote: Paula Cross wrote: I want to know how to change the grammar and style option that calls out sentences that are more than 60 words per sentence. I want to change the grammar checking so when I run the Spelling and Grammar tool, it will flag sentences with more than 25 words, rather than 60 words. thanks, Paula That grammar rule can't be changed. The following macro will apply a yellow highlight to every sentence longer than 25 words (although this is Microsoft's internal definition of "word", which includes certain punctuation marks). Sub LongSentences() Const Limit = 25 ' == change this if needed Dim mySent As Range For Each mySent In ActiveDocument.Sentences If mySent.Words.Count = Limit Then MsgBox mySent.Words.Count mySent.HighlightColorIndex = wdYellow End If Next End Sub See http://www.gmayor.com/installing_macro.htm if needed. After you run the macro, use the Edit Find dialog to search for highlighted text. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
spelling/grammar check, add to dictionary not offered as option | Microsoft Word Help | |||
How to get Spell&Grammar option in Word97 under WinXP limited acc' | Microsoft Word Help | |||
Grammar & Style €“ Settings | Microsoft Word Help | |||
abbreviations defined before use - Grammar & style option | Microsoft Word Help | |||
Can you use AP Style for Grammar Checking in MS Word | Microsoft Word Help |