T
Thomas M
Word 2000
What is the easiest way to delete all the page breaks in a document? I
recorded the following:
Selection.HomeKey Unit:=wdStory
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^m"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
This seems to work well, but if the document was large it could take a
while to search through the entire document.
I'm wondering if there is another way to do this, maybe by using a
collection or something, where the code would loop through all the page
breaks in the document and delete them. I thought that I was on to
something when I was reading about the Sections collection, but that does
not appear to apply to page breaks.
--Tom
What is the easiest way to delete all the page breaks in a document? I
recorded the following:
Selection.HomeKey Unit:=wdStory
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^m"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
This seems to work well, but if the document was large it could take a
while to search through the entire document.
I'm wondering if there is another way to do this, maybe by using a
collection or something, where the code would loop through all the page
breaks in the document and delete them. I thought that I was on to
something when I was reading about the Sections collection, but that does
not appear to apply to page breaks.
--Tom