|
本帖最后由 duquancai 于 2016-6-10 01:03 编辑
请测试(注意备份!)
Sub test()
Dim oAer As Range
On Error Resume Next
Set oAer = ActiveDocument.Content
oAer.Cut: oAer.PasteSpecial , , wdInLine, , wdPasteText
With ActiveDocument.Content.Find
.MatchWildcards = True
.Text = "您的答案"
Do While .Execute
With .Parent
.Expand wdParagraph
.Delete
End With
Loop
End With
End Sub
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Sub test2()
Dim oAer As Range, str$
Application.ScreenUpdating = False
With ActiveDocument.Content.Find
.Replacement.Text = "^p"
.Execute "^l", , , 1, , , , , , , wdReplaceAll
.Text = "您的答案"
Do While .Execute
Set oAer = .Parent
With .Parent
.Expand wdParagraph
oAer = str
.Collapse wdCollapseEnd
End With
Loop
End With
Application.ScreenUpdating = True
End Sub
|
|