View Single Post
 
Old 06-24-2017, 11:53 AM
iwonder iwonder is offline Windows 10 Office 2013
Novice
 
Join Date: Jun 2017
Location: France
Posts: 10
iwonder is on a distinguished road
Default

Thanks Greg, but this asks for reformatting but dosen't show the selected word to reformat...
Something is missing i guess

Quote:
Originally Posted by gmaxey View Post
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
Reply With Quote