|
楼主 |
发表于 2016-5-9 19:21
|
显示全部楼层
师傅好!
由于这几天比较忙,前几天那个代码没在意具体是那一个,记不起来了,今天下午找了一下午都没找到,刚才试了一下师傅给的这个代码,打开附件按F8光标好像也不是逐行跳过,代码内7~10行也是一下跳过,而代码运行替换都正常。
Sub 查找替换()
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Do While Selection.Find.Execute(FindText:=":", Forward:=True)
Selection.MoveStart Unit:=wdCharacter, Count:=-1
Selection.MoveEnd Unit:=wdCharacter, Count:=1
If Selection Like "[0-9]?[0-9]" Then
Selection.MoveStart Unit:=wdCharacter, Count:=1
Selection.MoveEnd Unit:=wdCharacter, Count:=-1
Selection.Font.Color = wdColorRed
If Selection.Font.Color = wdColorRed Then Selection.Text = "∶"
End If
Selection.MoveRight Unit:=wdCharacter, Count:=1
Loop
End Sub
|
|