I've seen in several posts how to split each page in a document into a
separate document. And I've seen how to search / replace hard page breaks.
What I can't figure out is how to combine them and do the following -
Take the pages between each hard page break and save them into separate
documents.
The logic should be simple - start a range, go to the next hard page break,
end the range, copy the range, throw it to a new document and save it. But
nailing the ranges by hard page break is killing me.
Thanks in advance.
Charles Kenyon - 08 Mar 2006 22:46 GMT
Hard page breaks are an anathema. Avoid them if at all possible. Can you use
page-break-before paragraph formatting or next-page section breaks instead?

Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
> I've seen in several posts how to split each page in a document into a
> separate document. And I've seen how to search / replace hard page
[quoted text clipped - 9 lines]
>
> Thanks in advance.
Jack - 08 Mar 2006 22:57 GMT
You lost me there - are you referring to detecting page breaks or existing
page breaks in the document? The document has ~30 pages, most of them
having a [ctrl]+[enter] (hard page break) after a paragraph or two. Some
paragraphs are extremely long and run over to multiple pages. I need to
parse through each of the [ctrl]+[enter] and put any pages between them to a
separate document.
> Hard page breaks are an anathema. Avoid them if at all possible. Can you
> use page-break-before paragraph formatting or next-page section breaks
[quoted text clipped - 12 lines]
>>
>> Thanks in advance.
Charles Kenyon - 08 Mar 2006 23:16 GMT
I'm referring to hard page breaks. They exist inside paragraphs, which is
where you run into problems, or at least one part of where you run into
problems. You have to work with what you have, just letting you know. Word
just isn't set up to deal with pages as units until print time. I would
suggest trying (on a copy) replacing the hard page breaks with next-page
section breaks and then working with some of the code you've seen.

Signature
Charles Kenyon
Word New User FAQ & Web Directory: http://addbalance.com/word
Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
> You lost me there - are you referring to detecting page breaks or existing
> page breaks in the document? The document has ~30 pages, most of them
[quoted text clipped - 19 lines]
>>>
>>> Thanks in advance.
Doug Robbins - Word MVP - 09 Mar 2006 05:02 GMT
You should be able to use Find and Replace to replace the hard page breaks
with Section Breaks and then use the following macro:
Dim i As Long, Source as Document, Target as Document, Letter as Range
Set Source = ActiveDocument
For i = 1 to Source.Sections.Count
Set Letter = Source.Sections(i).Range
Letter.End=Letter.End-1
Set Target = Documents.Add
Target.Range=Letter
Target.SaveAs FileName:="Letter" & i
Target.Close
Next i

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> I've seen in several posts how to split each page in a document into a
> separate document. And I've seen how to search / replace hard page
[quoted text clipped - 9 lines]
>
> Thanks in advance.