Last active
April 14, 2020 13:53
-
-
Save michaelHL/bb71f5f11e915bd64fa969f1631a1546 to your computer and use it in GitHub Desktop.
word首字母大写
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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