在总轧差(含数字)后面继续查找段落标记
查找后再插入 break;
但是结果是多次插入了break,并且还多插入了一页;
请诸位帮忙解决。
Sub Macro1()
Do
Set myrange = Word.Selection.Find
myrange.ClearFormatting
myrange.Execute FindText:="总轧差"
If myrange Is Nothing Then Exit Do
'Set myrange2 = ActiveDocument.Selection = "^p"
Set myrange2 = Selection.Find
myrange2.ClearFormatting
myrange2.Execute FindText:="^p", Format:=True, Forward:=True
If Not myrange2 Is Nothing Then
Selection.InsertBreak Type:=wdPageBreak
End If
'Selection.Find.Execute
Loop While Not myrange Is Nothing
End Sub
|