Computer Guy
asked on
Mail Merge With Word
Hi,
I have an excel spreadsheet
Column A is the section. There are 2 values for the section P and W. I want the names with section P to be one area and the names with section W in another.
I tried using some mail merge rules: Next Record If
Next Record If Not Blank and Section Equal To P
When I do this, it shows all of the records in the P section, not separated.
Word-Demo.docx
Excel-Demo.xlsx
Should-Look-Like.docx
I have an excel spreadsheet
Column A is the section. There are 2 values for the section P and W. I want the names with section P to be one area and the names with section W in another.
I tried using some mail merge rules: Next Record If
Next Record If Not Blank and Section Equal To P
When I do this, it shows all of the records in the P section, not separated.
Word-Demo.docx
Excel-Demo.xlsx
Should-Look-Like.docx
This is an update of what the fields would look like for your data.
{ IF { MERGESEQ } = "1" "Section { MERGEFIELD SECTION }"
"" }{ SET Place1 { MERGEFIELD SECTION }}
{ If { Place2 } <> { Place1 }
"Section { MERGEFIELD SECTION }
{ MERGEFIELD FIRST } { MERGEFIELD LAST }" "{ MERGEFIELD FIRST } { MERGEFIELD LAST }" }{ SET Place2 { MERGEFIELD SECTION }}
There is an article here that has some VBA code to convert the text simulation of the Word field code display (as above) to actual Word fields. You might find it useful here.
{ IF { MERGESEQ } = "1" "Section { MERGEFIELD SECTION }"
"" }{ SET Place1 { MERGEFIELD SECTION }}
{ If { Place2 } <> { Place1 }
"Section { MERGEFIELD SECTION }
{ MERGEFIELD FIRST } { MERGEFIELD LAST }" "{ MERGEFIELD FIRST } { MERGEFIELD LAST }" }{ SET Place2 { MERGEFIELD SECTION }}
There is an article here that has some VBA code to convert the text simulation of the Word field code display (as above) to actual Word fields. You might find it useful here.
ASKER
Do you have any already put together solutions I can build off of?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This is what the fields would look like in your case:
{ IF { MERGESEQ } = "1" "{ MERGEFIELD SECTION }¶
" "" }{ SET Place1 { MERGEFIELD SECTION }}¶
{ If { Place2 } <> { Place1 }"¶
{ MERGEFIELD SECTION }¶
¶
{ MERGEFIELD FIRST } { MERGEFIELD LAST }" "{ MERGEFIELD FIRST } { MERGEFIELD LAST }" }{ SET Place2 { MERGEFIELD SECTION }}
There are other ways, mainly using VBA which I suggest in this question:
https://www.experts-exchange.com/questions/23658368/Doing-a-mail-merge-with-section-breaks-using-a-specific-value.html