Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 03-08-2016, 06:10 PM
macropod's Avatar
macropod macropod is offline How to select different words at once Windows 7 64bit How to select different words at once Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,525
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
When you're done editing, you can re-run the macro with:
.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]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to select different words at once 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 select different words at once 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
How to select different words at once 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

Other Forums: Access Forums

All times are GMT -7. The time now is 09:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft