The manual page breaks make it quite easy to use Find and Replace for what
might otherwise be more complex.
1. Add an extra page break at front and rear so that all (original) pages
are bound by two page breaks
2. Replace All PageBreak-TextWithoutHighLight-PageBreak by PageBreak
3. Remove the extra page breaks added in step 1.
Step 2 actually needs to repeated (as often as necessary) because it doesn't
automatically delete consecutive pages without highlighting.
Here's some code:
With ActiveDocument
.Range(.Range.Start, .Range.Start).InsertBreak wdPageBreak
.Range(.Range.End - 1, .Range.End - 1).InsertBreak wdPageBreak
With .Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Highlight = False
.MatchWildcards = True
.Text = "^m*^m"
.Replacement.Text = "^m"
.Wrap = wdFindContinue
.Format = True
While .Execute
.Execute Replace:=wdReplaceAll
Wend
End With
.Range(.Range.Start, .Range.Start).Delete
.Range(.Range.End - 2, .Range.End - 1).Delete
End With
--
Enjoy,
Tony
> * i am currently using MS Word 2000
>
[quoted text clipped - 7 lines]
>
> * any ideas on how to implement this action with a macro?