Breaking A Large Document into Separate Documents

S

samuelmuindi

I have a very large document that I would like to break up into
smaller files based on manually inserted page breaks. In other words,
this very big document has sections delineated by these inserted line
breaks. The sections are also marked with an "·".

So ideally I would like find a way to find each "page command + ·" and
then export the text between that marker and the next "page command +
·" into a new document.

Is this possible?
 
B

Bates

I have a very large document that I would like to break up into
smaller files based on manually inserted page breaks. In other words,
this very big document has sections delineated by these inserted line
breaks. The sections are also marked with an "·".

So ideally I would like find a way to find each "page command + ·" and
then export the text between that marker and the next "page command +
·" into a new document.

Is this possible?

I don't know of any built in function for this but it really would not
be that hard to write a VBA macro to do it I wouldn't think....
 
S

samuelmuindi

Hi Bates, thanks for the quick response. I'm afraid that I don't
really what a "VBA macro" is. Also, your message appears to have been
cut off.
 
D

Daiya Mitchell

Can you describe the document a little more? These are page breaks, not
section breaks, is that right? Are there any other page breaks in the
document?

About how many separate documents are you trying to end up with?
 
S

samuelmuindi

Sure, here are the document stats:

-It has 816 manually inserted page breaks (there are no section breaks
and no other breaks of any kind apart from those naturally inserted by
word).
-There are 1186 total single spaced pages.
-There is no other formating of any kind apart from a manually
inserted "·" at the start of each new entry/section (which I would
like to become a separate word document) that follows each manually
inserted page break.

Thanks to all.
 
J

John McGhie

Yes. You can do this in seconds: you don't need a macro, and it is a
built-in function.

Mark each page break location with a Heading 1 style.

It MUST be the built-in style Heading 1.

Then:

1) Go into Outline View

2) On the Toolbar that appears, click the "Master Document View" button.

3) Select all the text

4) Click "Create Subdocument" on the Master Document toolbar

5) Hold down the Shift key and choose Save All from the File menu.

It helps if your Heading 1 paragraphs are really headings, because each
document will be saved with that text as its file name.

This operation splits the document at every Heading with the style that
occurs first in your selection. So if you had Headings 1, 2, and 3 in the
document, but the top of your selection began with a Heading 2 style, it
would split the document at every Heading 2 style in your selection.

After you have done this, you can discard the master document: all of the
text should now be in the individual files.

Cheers


I have a very large document that I would like to break up into
smaller files based on manually inserted page breaks. In other words,
this very big document has sections delineated by these inserted line
breaks. The sections are also marked with an "·".

So ideally I would like find a way to find each "page command + ·" and
then export the text between that marker and the next "page command +
·" into a new document.

Is this possible?

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Consultant Technical Writer
McGhie Information Engineering Pty Ltd
http://jgmcghie.fastmail.com.au/
Nhulunbuy, NT, Australia. S12.22.1918,E136.99.5392
+61 4 1209 1410, mailto:[email protected]
 
B

Bates

Yes. You can do this in seconds: you don't need a macro, and it is a
built-in function.

Mark each page break location with a Heading 1 style.

It MUST be the built-in style Heading 1.

Then:

1) Go into Outline View

2) On the Toolbar that appears, click the "Master Document View" button.

3) Select all the text

4) Click "Create Subdocument" on the Master Document toolbar

5) Hold down the Shift key and choose Save All from the File menu.

It helps if your Heading 1 paragraphs are really headings, because each
document will be saved with that text as its file name.

This operation splits the document at every Heading with the style that
occurs first in your selection. So if you had Headings 1, 2, and 3 in the
document, but the top of your selection began with a Heading 2 style, it
would split the document at every Heading 2 style in your selection.

After you have done this, you can discard the master document: all of the
text should now be in the individual files.

Cheers





--
Don't wait for your answer, click here:http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Consultant Technical Writer
McGhie Information Engineering Pty Ltdhttp://jgmcghie.fastmail.com.au/
Nhulunbuy, NT, Australia. S12.22.1918,E136.99.5392
+61 4 1209 1410, mailto:[email protected]

Very Cool.
 
D

Daiya Mitchell

Alternative VBA solution--which means a little piece of code (macro)
that you can run that will do this automatically. I've not tested this
myself--you might cut your doc down to create a 10-section document to
test it on, first.

It is entirely possible that this is harder and more work than applying
816 headings. It certainly requires more research, if less manual
repetition.

One approach--

Make a COPY of your document and work with the copy, or put a copy in a
safe place.

Someone wrote a "splitter" macro that will split a doc with many
sections into separate docs, and the macro is here:
<http://groups.google.com/group/micr...read/thread/164f20e42c7a536f/75c38a2522990de0>

Instructions on how to use a macro are here:
<http://word.mvps.org/Mac/InstallMacro.html>

BUT, you can't use the macro on your document as is, because you have
page breaks, not section breaks. So FIRST you have to convert the page
breaks to section breaks. First, insert a Next Page Section Break. Copy
it to your clipboard. Then bring up Find and Replace. Click the triangle
to expand the dialog. Put the cursor in Find and use the Special menu to
select Manual Page Break.

Then put the cursor in Replace and use the Special menu to select
Clipboard contents.

Now your page breaks are section breaks. Now you can use the splitter
macro. Note that you will have to change the filepath to save the
document to, and change it to a Mac-friendly location. I've not tried
this on a Mac, but since the macro was written in 1998, Mac VBA should
be up to that.
 
S

samuelmuindi

Thanks so much for these ideas. I'm afraid I wasn't able to debug the
VBA macro, but I did manage to get John McGhie's solution to partially
work. His approach does indeed work but Word choaked on the size of
the document and gave me the "too many open files" error message. Of
course I can just chop the main document into smaller more bite sized
pieces to make this work.

Best all.
 
D

Daiya Mitchell

The VBA problems are probably due to incorrect spaces and line breaks
from pasting from the web--fixable but tricky.

Glad you've got an approach that works for you.
 
W

WG

I usually break down a big document by preparing lots of small documents and then combining them in a master document. However the Master Document View menu is not there!!! Doesn't it exist in Office 2008? I have a document which I prepared in Word for Mac 2004 which was a Master and where I could expand all the subdocuments but now I can't do that. Anyone got an idea?

thanks
 
D

Daiya Mitchell

Switch into Outline View, and then use the icon on the far right of the
outlining toolbar to go to MD View and the MD toolbar will pop up.
 
S

Sheila O'Flanagan

Switch into Outline View, and then use the icon on the far right of the
outlining toolbar to go to MD View and the MD toolbar will pop up.

WG wrote:
&gt; I usually break down a big document by preparing lots of small
&gt; documents and then combining them in a master document. However the
&gt; Master Document View menu is not there!!! Doesn't it exist in Office
&gt; 2008? I have a document which I prepared in Word for Mac 2004 which
&gt; was a Master and where I could expand all the subdocuments but now I
&gt; can't do that. Anyone got an idea?
&gt;
&gt; thanks

The Master Doc function was very useful and I don't know why it's so difficult to find or why you have to go to Outline View. It is there. However this whole thing about headings is freaking me out. Why are the headings in the master doc different and why then does it give me options to change the headings in the sub documents? Having said change all in the subdocuments when I tried to expand them I got a message saying they weren't there! Yet if I doubleclicked on them within the master they were.

I'm really frustrated. I have 40 short docs that I want to include in a Master but have so far wasted 2 hours trying to work this out. Prior to 08 I had no problems at all!
 
D

Daiya Mitchell

Hi Sheila,

You need to repost your question as a NEW thread, including OS and Word
version, rather than hijacking an old thread. Also, I can't make heads
nor tails of what you are talking about. Try giving some concrete
examples of what you do, what you want to happen, and what happened instead.
 
J

John McGhie

Hi Daiya:

It's OK, I know what she means :) I will answer the post in the new thread
:)

Cheers


Hi Sheila,

You need to repost your question as a NEW thread, including OS and Word
version, rather than hijacking an old thread. Also, I can't make heads
nor tails of what you are talking about. Try giving some concrete
examples of what you do, what you want to happen, and what happened instead.

--
Don't wait for your answer, click here: http://www.word.mvps.org/

Please reply in the group. Please do NOT email me unless I ask you to.

John McGhie, Consultant Technical Writer
McGhie Information Engineering Pty Ltd
http://jgmcghie.fastmail.com.au/
Sydney, Australia. S33°53'34.20 E151°14'54.50
+61 4 1209 1410, mailto:[email protected]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top