iT邦幫忙

0

VBA WORD如何只搜尋不取代

With Selection.Find
        .Text = "施工機具:"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindAsk
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchByte = True
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute Replace:=wdReplaceAll

明明沒有Selection.Find.ClearFormatting這句 為何還是會取代
哪裡不對呢 先多謝告知

1 個回答

0
海綿寶寶
iT邦大神 1 級 ‧ 2020-07-27 17:17:51
最佳解答
Selection.Find.Execute Replace:=wdReplaceAll

改成

Selection.Find.Execute Replace:=wdReplaceNone

試試看

跑出我要的結果了 多謝大神告知

問題解決就好

我要發表回答

立即登入回答