Share via

Automating collation of master word document with inputs from over 200 people

Anonymous
2019-07-06T09:17:10+00:00

Hi everyone! Would greatly appreciate any help or advice on how to automate my work process: 

I have a master document (over 100 pages long) with different chapters, sections and sub-sections that require annual updates from over 200 people in my organisation. 

Currently, I manually extract each section (as separate word documents) and email it to each point of contact to check on whether there are any updates to the section(s) under their care. I would go then through their returns one by one and compare it with the existing master document and make amendments, if any.

Just wondering if there would be a way to:

  1. Extract and send out these sections automatically (using excel macros perhaps?) to the various points of contact 
  2. Collate the returns automatically (i.e. merge and sort the returns by chapter and section number). 

Thank you!!

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Doug Robbins - MVP - Office Apps and Services 323K Reputation points MVP Volunteer Moderator
    2019-07-07T03:16:57+00:00

    It sounds like what you are referring to as "sections" are not the same thing as Sections that are created in a Word document by inserting Section Breaks.

    If you toggle on the display of non-printing characters in your document, is each of the "section headings" preceded by a Section Break of some form - (Next Page), (Continuous), (Even Page), or (Odd Page) ?

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Doug Robbins - MVP - Office Apps and Services 323K Reputation points MVP Volunteer Moderator
    2019-07-06T10:18:09+00:00

    If the part to be reviewed\revised by each individual is in a separate Section of the document, that is they are separated by Section Breaks, the following Word macro would create a separate document for each Section in the source document

    Sub splitter()

    ' splitter Macro

    ' Macro created by Doug Robbins to save each Section of a document

    ' as a separate file, retaining the header and footer information.

    Dim i As Long, Source As Document, Target As Document, rngSection As Range

    Set Source = ActiveDocument

    For i = 1 To Source.Sections.Count

        Set rngSection = Source.Sections(i).Range

        Set Target = Documents.Add

        Target.Range = rngSection

        Target.Sections(2).PageSetup.SectionStart = wdSectionContinuous

        Target.SaveAs2 FileName:="[DriveLetter:\path]Section" & i & ".docx"

        Target.Close

    Next i

    End Sub

    in place of [DriveLetter:\path] insert the path to the folder into which the documents will be saved

    Then, if you had an Excel data source with fields for Section and Email address, and you populated the Section field with data consisting of the path and filename of each of the documents created by the above macro, you could attach that data source to a letters type mail merge main document that contained the text of an message that you may want to send to each recipient and then use the Merge with Attachments facility on my Merge Tools Add-in that is contained in the MERGE TOOLS ADD-IN.zip file that you can download from the following page of my One Drive:

    http://bit.ly/1hduSCB

    to email each document to the recipient.

    When you download the archive, extract the files from it and read the:

    “READ ME – Setting up and using the Merge Tools Add-in.pdf

    to see how to install and use the various tools.  Using those tools, it is possible to perform the following types of merge that cannot be done with Mail Merge “out-of-the-box”:

    ●    Merge to e-mail messages either with or without attachments, with the documents created by the merge being sent as either Word or PDF attachments or as the body of the e-mail message.

    ●    Merge to individual documents in either Word or PDF format with the filenames being supplied by the data in one of the fields in the data source

    ●    Many to One type merges, which can be used for creating documents such as invoices where there are multiple records in the data source that have common data in one of the fields

    ●    Merging to a document that will include a chart that is unique to each record in the data source

    ●    Merging a document with Content Controls

    ●    Merging a document that contains Legacy FormFields

    ●    Duplex Merges

    ●    Merging to a printer that will collate and staple the output created from each record in the data source.

    The requirements for using the system are:

    ●    The mail merge main document must be of the Letters type, though that does not mean that the output cannot be sent as an e-mail message where relevant.

    ●    For the Many To One, Merge with Attachments and Merge to Individual Docs utilities, the data source may be either a table or query in an Access database, or in the form of an Excel worksheet and that worksheet must be the first sheet in the Excel workbook. If the data is on some other sheet, you can easily move that sheet so that it is the first sheet in the workbook by clicking on the sheet tab and dragging it to the left.  For the Chart Merge utility, see the Mail Merging with Charts document that is included in the Merge Tools Add-in Zip file for additional requirements for the data source for use with that utility

    ●    For a data source in the form of an Excel worksheet, the field names must be in the first row of the worksheet and there must be a field name in all of the cells in that row that are within the range of columns that contain the data.

    ●    For both types of data source, the field names must contain only alphanumeric characters (No @,#,$,%,&,(,), etc) and the field names must not start with a numeric character (0-9). The number of characters in the field names, including spaces, must not be more than 40

    When you receive all of the returned documents, you could then use a macro containing the following code in Word to re-compile them into a single document. 

    Dim i As Long, Source As Document, Target As Document, rngSection As Range

    Set Target = ActiveDocument

    For i = 1 To 200 'replace with the actual number.

        Set Source = Documents.Open("[DriveLetter:\path]Section" & i & ".docx")

        Target.Range.InsertAfter Source.Range.FormattedText

        Source.Close wdDoNotSaveChanges

    Next i

    You should run that macro when a blank document is open with that blank document having the same page layout (page size and margins) as the original document.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2019-07-07T01:33:57+00:00

    Dear Doug,

    Thank you for the prompt reply and help! 

    Would it be possible to modify the code such that it names each section according to the section heading (e.g. 1.1.1, 1.1.2 etc.)? I understand that the ascending order from 1 to 200 would allow word to piece the document back together with the updated returns. However, it would be ideal if it could follow the section heading numbers.  

    Unfortunately my work computer does not allow for the installation of add-ons. I found the following macro which may help? (http://www.rondebruin.nl/win/s1/outlook/amail6.htm). It would be ideal if the email could be created in word instead of typing it directly into the code as I have a specific template to follow for the email message. 

    Thanks!

    Was this answer helpful?

    0 comments No comments