![]() |
|
#6
|
||||
|
||||
|
Word has no facility for highlighting parts of speech. For prepositions, though, you could use Find/Replace to highlight them all, then remove the highlights when you're done editing. A macro you could use to expedite this is:
Code:
Sub Demo()
Application.ScreenUpdating = False
Options.DefaultHighlightColorIndex = wdYellow
Dim StrFnd As String, i As Long
StrFnd = Array("above", "about", "across", "against", "along", _
"among", "around", "at", "before", "behind", "below", "beneath", _
"beside", "between", "beyond", "by", "down", "during", "except", _
"for", "from", "in", "inside", "into", "like", "near", "of", _
"off", "on", "since", "to", "toward", "through", "under", _
"until", "up", "upon", "with", "within")
With ActiveDocument.Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Forward = True
.Wrap = wdFindContinue
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Replacement.Text = "^&"
.Replacement.Highlight = True
For i = 0 To UBound(StrFnd)
.Text = StrFnd(i)
.Execute Replace:=wdReplaceAll
Next
End With
Application.ScreenUpdating = True
End Sub
.Replacement.Highlight = False instead of: .Replacement.Highlight = True For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm For Mac macro installation & usage instructions, see: http://word.mvps.org/Mac/InstallMacro.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Capitalize one to two words if they are the only words on a line
|
jrhlavac | Word VBA | 1 | 10-08-2015 08:19 PM |
| Finding Non-English Words in an English and Non-English words document | mohsen.amiri | Word | 3 | 03-31-2015 11:20 PM |
How to mark underlined words in a sentence as A, B, C, D (beneath the words)
|
thudangky | Word | 13 | 12-12-2013 02:22 AM |
Macro for select words?
|
Megan Sprack | Word | 1 | 08-23-2012 03:03 PM |
| Why Words doesn’t show the style of the selected words automatically???? | Jamal NUMAN | Word | 0 | 04-14-2011 03:20 PM |