View Single Post
 
Old 01-14-2011, 08:08 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,387
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

Hi angeltread,

Try the following macro:
Code:
Sub Capitalize()
Application.ScreenUpdating = False
Dim oRng As Range, fRng As Range
With Selection
  Set oRng = .Range
  With .Find
    .ClearFormatting
    .MatchWildcards = True
    .Wrap = wdFindContinue
    .Forward = True
    .Text = ": [a-z]"
    Do While .Execute = True
      Set fRng = ActiveDocument.Range(Start:=Selection.Start, End:=Selection.End)
      With fRng
        .Text = UCase(.Text)
        .Collapse Direction:=wdCollapseEnd
      End With
    Loop
  End With
End With
oRng.Select
Set fRng = Nothing: Set oRng = Nothing
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote