Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-08-2016, 06:52 AM
gmaxey gmaxey is offline Locate ALL CAPS in a paragraph Windows 7 32bit Locate ALL CAPS in a paragraph Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,636
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

I assume that you are aware that your code will not find three letter CAPS that start the document, end a sentence or paragraph
Code:
Sub DeleteCap3Word()
Dim oRng As Word.Range
Set oRng = ActiveDocument.Range
  With oRng.Find
    .ClearFormatting
    .Text = " [A-Z]{3} "
    .Replacement.Text = " "
    .Forward = True
    .Wrap = wdFindStop
    .Format = True
    .MatchCase = True
    .MatchWholeWord = True
    .MatchWildcards = True
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    While .Execute
      Select Case Trim(oRng)
       Case "USB", "PSA"
       
       Case Else
         oRng.Text = " "
     End Select
     oRng.Collapse wdCollapseEnd
   Wend
  End With
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Powerpoint 2013 unable to locate word bc320 PowerPoint 0 06-22-2015 08:00 AM
Cannot Locate Archived Messages abraxis Outlook 0 06-10-2014 03:32 PM
Microsoft Office Professional 2010 on Windows 8 problem error cannot locate pst files CDM Outlook 0 12-21-2013 06:36 AM
Can't find Office 2010 product key. How to locate it? alecus Office 1 07-24-2012 04:00 PM
Unable to locate Microsoft Office 2003 Language settings. EzyMe Office 0 09-28-2010 01:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:56 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