PDA

View Full Version : Mail Merge Split



mikemc24
11-29-2008, 06:58 AM
I am new to macros and mail merge.

I would like to split a mail merge document by letter, there are four pages to each letter.

Unfortunately there are serveral continuous section breaks in the letter but there is only one next page section break at the end of the fourth page.

Is there a way I can ask the macro to ignore continuous section breaks an just identify and split the document on the next page section break or am I going about it the wrong way.

Guidance and help would be appreciated.

TonyJollans
11-29-2008, 10:17 AM
Doug Robbins has an AddIn that will create individual documents as part of the mail merge process. See http://www.gmayor.com/individual_merge_letters.htm

If you already have the one big document - and can't rerun the merge - come back and we'll sort something out

mikemc24
11-29-2008, 12:11 PM
Thanks for the reply Tony, I will try that on Monday.

Going back to original question, is there a way to get a macro to ignore continuous section breaks in the letter and only identify the page section break at the end of the fourth page to perform the split.

TonyJollans
11-29-2008, 02:41 PM
Yes, you can do it. In general, you need to realise that what is indicated on a Section Break is a property of the following Section (and not a characteristic of the section break itself), so, in code, you would go through each Section checking its Start Type and taking appropriate action.

More specifically, in this case, perhaps, if every merge result contains the same number of sections, you could shortcut the process simply by counting sections and ignoring their type - taking the Range from Section(n).Start to Section(n+4 or 5 or whatever).End