View Single Post
 
Old 06-24-2017, 11:19 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Sub ALLCAPS_TO_SMALLCAPS()
Application.ScreenUpdating = False
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "<[A-Z][A-Z]*>"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchWildcards = True
    While .Execute
      oRng.Select
      If MsgBox("Reformat?", vbQuestion + vbYesNo) = vbYes Then
        oRng.Case = wdTitleWord
        oRng.Font.SmallCaps = True
      End If
      oRng.Collapse wdCollapseEnd
    Wend
  End With
Application.ScreenUpdating = True
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote