|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub Macro4()
- Selection.HomeKey Unit:=wdStory '不能添加监视Selection.Find.Execute,否则相当于在执行一次查找,即使不在本模块也不行
- With Selection.Find
- .ClearFormatting
- .MatchWildcards = True
- .Text = "[一-﨩]*^13"
- .Forward = True
- Do While .Execute
- Selection.MoveRight Unit:=wdCharacter, Count:=1 '添加监视Selection.Range.Text
- Selection.EndKey Unit:=wdLine, Extend:=wdExtend
- If Left(Selection.Range.Text, 7) = "http://" Then
- netd = Selection.Range.Text
- Selection.MoveRight Unit:=wdCharacter, Count:=1
- Selection.EndKey Unit:=wdLine, Extend:=wdExtend
- netd = netd & IIf(Left(Selection.Range.Text, 7) = "http://", Selection.Range.Text, "")
- Selection.MoveDown Unit:=wdParagraph, Count:=1
- .Text = "[a-zA-Z]"
- .MatchWildcards = True
- .Execute
- Selection.MoveRight Unit:=wdCharacter, Count:=1
- Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
- Selection.MoveDown Unit:=wdLine, Count:=1
- Selection.InsertAfter netd
- Selection.MoveRight Unit:=wdCharacter, Count:=1
- .Text = "[一-﨩]*^13"
- .MatchWildcards = True
- Else
- Selection.MoveDown Unit:=wdParagraph, Count:=1
- End If
- Loop
- End With
- End Sub
复制代码 |
|