不知错在那里,代码运行后好像没有反应! Sub lqxs() Dim d, k, t, i& Set d =CreateObject("Scripting.Dictionary") d.Add "1.1", "2.1" d.Add "1.2", "2.2" d.Add "1.1.1","2.2.1" d.Add "1.1.2","2.2.2" d.Add "1.1.1.1","2.2.2.1" d.Add "1.1.1.2","2.2.2.2" k = d.keys: t = d.items For i = o To UBound(k) ActiveDocument.Content.Select With Selection.Find .Forward = True .Text = k(i) .Replacement.Text = t(i) .Execute Replace:=wdReplace0ne Selection.HomeKey Unit:=wdLine Selection.EndKey Unit:=wdLine,Extend:=wdExtend End With Next End Sub
|