Skip to content

Instantly share code, notes, and snippets.

@michaelHL
Last active April 14, 2020 13:53
Show Gist options
  • Save michaelHL/bb71f5f11e915bd64fa969f1631a1546 to your computer and use it in GitHub Desktop.
Save michaelHL/bb71f5f11e915bd64fa969f1631a1546 to your computer and use it in GitHub Desktop.
word首字母大写
Sub captical()
Selection.WholeStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
.SmallCaps = False
.AllCaps = True
End With
With Selection.Find
.Text = "<([A-Za-z])"
.Replacement.Text = "\1"
.Forward = True
.Wrap = wdFindAsk
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment