Generating Multiple Documents from sections of Multiple Documents

  • Thread starter Thread starter Raja Y. Anastas
  • Start date Start date
R

Raja Y. Anastas

Hi,

I have multiple audit documents that are based on the same template. Each of
these documents pertains to an audit report of a branch of our company. The
report includes different sections that are of importance to central units
responsible for the branches operations, each unit in its domain.

Is there a way to join all the sections of all the documents based on the
central unit function using cross references or other features in Word? This
way each central unit can receive in a file all the sections pertaining to
it from all branch reports.

Appreciate your ideas on this matter.

Thanks in advance.
 
If I understand you correctly, you want to create a new series of documents,
one of which would be comprised of all of the Section 1's from an existing
series of documents, another would be comprised of all of the Section 2's
and so on.

This could be done with a batch processing macro if all of the documents
were in the same folder. One thing that would need to be known is if it was
critical in which order all of the Section 1's for example were arranged in
the new document.


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
Hi Doug,

Thank you for your prompt reply.

What you explained is exactly what I need. I cannot define however how I can
set up the template to segregate the different sections, i.e. should I use
bookmarks, cross-reference or any other feature that I never used in Word
before?

Once the setting of the template is defined I think I can find ways to merge
the sections into new documents, either using VBA or macros.

Appreciate your feedback.


"Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS"
 
Hi Raja,

I guess I had assumed that the sections that you mentioned were sections as
the term is used it Word, that is, different parts of a document that are
separated by section breaks. I now realise that your use of the word
"section" may be not be what I had assumed, and rather that it means a parts
of the document that are of interest to the individual central units and
that they are not separated by section breaks.

If that is the case, how are these sections separated? Or, what
distinguishes the end of one section and the start of another.

Also, how many "sections" are there in each document? Is it always the same
number?

Also, do the documents already exist, or are you setting up a template to
use as the basis for the creation of the documents?
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
Hi again Doug,

Your assumption is correct (sorry for my vague initial posting). I was
referring to "virtual" sections, each composed of one or more paragraphs.
There should be the same number of "sections" within each document, a
"section" however can be empty.

The separation method is what I require. I was looking for best practice
suggestions in this matter.

Thanks again for your time and patience.

"Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS"
 
Hi Raja,

If you do have a section break between each "virtual section", it will
simplify the coding of the routine to extract each section from the original
documents and insert it into the new documents. This would be done by
referring to the .Range of each Section.

Say there are 10 sections in the original documents, we would then create 10
new documents which in VBA we would declare as Doc1 thru Doc10, then we
would open each of the original documents in turn, referring to it as
SourceDoc and use the following code

For i = 1 to 10
mydoc = "Doc" & i
mydoc.Range.InsertAfter SourceDoc.Sections(i)
Next i

You will find a routine that you can modify to create a batch process to
handle all of the original documents in the article "Insert into a document
the names of all files in a selected folder” at:

http://word.mvps.org/FAQs/MacrosVBA/InsertFileNames.htm


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
Thanks a lot Doug


"Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS"
 
Back
Top