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.

Re: Splitting document on hard page break by Charles

Charles
Wed Mar 08 16:46:14 CST 2006

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?
--
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.


"Jack" <anonymous@microsoft.com> wrote in message
news:ufCrlvvQGHA.1576@tk2msftngp13.phx.gbl...
> 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.
>



Re: Splitting document on hard page break by Jack

Jack
Wed Mar 08 17:00:39 CST 2006

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.


"Charles Kenyon" <wordfaq@nospam.addbalance.com> wrote in message
news:OX35bIwQGHA.5248@TK2MSFTNGP09.phx.gbl...
> 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?
> --
> 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.
>
>
> "Jack" <anonymous@microsoft.com> wrote in message
> news:ufCrlvvQGHA.1576@tk2msftngp13.phx.gbl...
>> 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.
>>
>
>



Re: Splitting document on hard page break by Charles

Charles
Wed Mar 08 17:16:14 CST 2006

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.
--
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.


"Jack" <anonymous@microsoft.com> wrote in message
news:upxA5NwQGHA.1868@TK2MSFTNGP09.phx.gbl...
> 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.
>
>
> "Charles Kenyon" <wordfaq@nospam.addbalance.com> wrote in message
> news:OX35bIwQGHA.5248@TK2MSFTNGP09.phx.gbl...
>> 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?
>> --
>> 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.
>>
>>
>> "Jack" <anonymous@microsoft.com> wrote in message
>> news:ufCrlvvQGHA.1576@tk2msftngp13.phx.gbl...
>>> 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.
>>>
>>
>>
>
>



Re: Splitting document on hard page break by Doug

Doug
Wed Mar 08 23:02:56 CST 2006

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


--
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

"Jack" <anonymous@microsoft.com> wrote in message
news:ufCrlvvQGHA.1576@tk2msftngp13.phx.gbl...
> 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.
>