|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
但是我还是再写一下吧!你会发现:嵌套的 还会继续修改代码的,因为你还有考虑不周的,没完没了!!!呵呵呵
Sub shishi()
Dim p As Paragraph, s As Range, r As Range
For Each p In ActiveDocument.Paragraphs
Set r = p.Range
With r
n = Len(r.Text)
If .MoveStartUntil("“", n) = 0 Then GoTo 100
.Start = .Start + 1
.MoveEndUntil "”", -n: .End = .End - 1
Set s = .Duplicate
With s.Find
Do While .Execute("“[!“”]@”", , , 1)
If Not s.InRange(r) Then Exit Do
With s
y = Len(s.Text)
.SetRange .Start, .Start: .MoveEnd , 1: .Text = "‘"
.MoveUntil "”", y: .MoveEnd , 1: .Text = "’"
.SetRange .End, .End
End With
Loop
End With
End With
100 Next
End Sub |
评分
-
1
查看全部评分
-
|