macro to split a document and rename both parts?

J

JustSomeGuy

A Word.doc, generated from a template named (i.e.) ‘Northeast Report.dot’,
has a unique filename: “Northeast Report Dec 08.docâ€. After the Report.doc is
all prepared, it needs to be split into two separate documents. The location
where this split needs to occur is marked with a ‘Next Page’ section break.
After the split, there needs to be two documents named as follows:
“Northeast Report Part I Dec 08.doc†and “Northeast Report Part II Dec
08.docâ€. After the split, the two files need to contain the same set of
styles and remain linked to ‘Northeast Report.dot’.

Problem:
When ‘average’ users try to perform the split manually, they run into
disappearing section footer issues, file naming errors (not always following
the required naming convention), and other little headaches. A simple
macrobutton at the end of the original.doc to automate the process, would be
a great help (‘when finished editing this document, simply CLICK HERE to
separate it into two parts’).

But as often happens, this seemingly simple task becomes pretty complex, the
more I analyze it from a macro authoring standpoint.

To ensure the styles and template links are preserved and (maybe) simplify
file renaming, should the macro first clone the original.doc, then process
the original and the clone (removing the unneeded parts from each clone and
modifying the names of each part)?

Or, should it simply go to a marker in the original.doc, copy the Part II
portion to the clipboard, save original.doc with a modified filename that has
“Part 1†embedded, and then create a new blank document, paste the contents
of part 2, and save the new blank.doc with ‘Part II’ embedded in its file
name?

Then there’s all the required syntax to navigate to the break point, perform
the split, perform the necessary file renaming, etc. – pretty daunting for a
WordBasic newbie – where should I start?
 

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