本帖最后由 duquancai 于 2017-7-11 22:49 编辑
weiyingde 发表于 2017-7-11 18:54
.Find.Execute "(D[\.、.]@[!^13]@^13)([\d]@[\.、.]@)", , , 1, , , , , , "\1【解析】^p\2", 2
不 ... Sub 添加解析()
Dim d As Document, b As Boolean
Set d = ActiveDocument
d.Content.Find.Execute "^13{2,}", , , 1, , , , , , "^p", 2
With d.Content.Find
Do While .Execute("^13[0-9]{1,}", , , 1)
If Not b Then
b = True
Else
With .Parent
.MoveUntil vbCr, wdBackward
If .MoveWhile("【解析】") Then
.Move 4, 1
Else
.MoveUntil vbCr
.Text = vbCr & "【解析】": .Move 4, 1
End If
End With
End If
Loop
End With
End Sub
|