Created
January 14, 2018 06:54
-
-
Save bitdust/12e3e251f014897fbb9bf3ab4fc7fd8f to your computer and use it in GitHub Desktop.
word宏,删除选中文字中的换行及空格,用于调整从PDF文件中复制出的文字格式
This file contains 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 删除换行及空格() | |
' | |
' 删除换行及空格 宏 | |
' 用于调整从PDF文件中复制出的文字格式 | |
' | |
Selection.Find.ClearFormatting | |
Selection.Find.Replacement.ClearFormatting | |
With Selection.Find | |
.Text = " " | |
.Replacement.Text = "" | |
.Forward = True | |
.Wrap = wdFindStop | |
.Format = False | |
.MatchCase = False | |
.MatchWholeWord = False | |
.MatchByte = True | |
.MatchWildcards = False | |
.MatchSoundsLike = False | |
.MatchAllWordForms = False | |
End With | |
Selection.Find.Execute Replace:=wdReplaceAll | |
Selection.Find.Replacement.ClearFormatting | |
With Selection.Find | |
.Text = "^p" | |
.Replacement.Text = "" | |
.Forward = True | |
.Wrap = wdFindStop | |
.Format = False | |
.MatchCase = False | |
.MatchWholeWord = False | |
.MatchByte = True | |
.MatchWildcards = False | |
.MatchSoundsLike = False | |
.MatchAllWordForms = False | |
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