问题描述
我可以一次查找并替换多个字母或符号吗?
我可以使用: selection.find.text =“(){}”“
代替此方法:
Dim b As String
Dim c As Integer
Dim punk As String
punk = "({})"""
b = Selection.Range.Characters.First
c = InStr( punk,b)
If c = 5 Then
GoTo x
ElseIf c = 2 Then
GoTo y
End If
Exit Sub
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
y: With Selection.Find
.Text = "}"
.Replacement.Text = ""
' a = Selection.Text
.Forward = True
.Wrap = wdFindStop
Selection.InsertAfter ChrW(64830)
Selection.InsertBefore ChrW(64831)
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.MatchSuffix = False
.MatchPrefix = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Exit Sub
End If
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)