当前位置: 主页 > Office办公 > Word专区 > Word教程 > Word2003教程 > 删除word文档中所有中文空格的宏代码

删除word文档中所有中文空格的宏代码

  • 2022-11-30
  • 来源/作者: Wps Office教程网/ 菜鸟图库
  • 239 次浏览

Sub DEL中文空格()

‘ DEL中文空格 宏


Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " "
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchByte = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub