Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-28-2015, 09:35 PM
Echevca Echevca is offline Mail Merge - List clients with different sets of products Windows 7 64bit Mail Merge - List clients with different sets of products Office 2010 64bit
Novice
Mail Merge - List clients with different sets of products
 
Join Date: Aug 2015
Posts: 3
Echevca is on a distinguished road
Question Mail Merge - List clients with different sets of products

I need to create a mail merge that will have a set of rules but not sure how to put the logic together. I am familiar setting mail merges but just the regular/basic ones.


I have clients with different set of products. For simplicity purposes lets pretend the products are called A, B, C, D. Not all clients have all four products. Client #1, for example only has products A and B; Client#2 only has product B and Client #3 only has products C and D.

My Excel file will look like this:


Client Product A Product B Product C Product D
Client 1 1% 2%
Client 2 2%
Client 3 3% 4%

I want to put a letter together that reference the % increase each product will incur without having to list all four products as a template and avoid spaces between the lines when there is no product. For example. the letter for carriers #1 will say that they are getting an increase for products A and B while the letter for Carrier #2 will say they are getting an increase for product. B....they will not see the other products listed since they don't have a % marked in the Excel file.


Is this feasible using the mail merge rules? If so, how do I put it together?


Your help will be greatly appreciated!
Reply With Quote
  #2  
Old 08-29-2015, 01:04 AM
gmayor's Avatar
gmayor gmayor is offline Mail Merge - List clients with different sets of products Windows 7 64bit Mail Merge - List clients with different sets of products Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

On the face of it from your description, this is a simple merge using conditional fields e.g.

{ IF { MERGEFIELD "Product A" } <> "" "Product A : { MERGEFIELD "Product A" }¶" }{ IF { MERGEFIELD "Product B" } <> "" "Product B : { MERGEFIELD "Product B" }¶" }{ IF { MERGEFIELD "Product C" } <> "" "Product C : { MERGEFIELD "Product C" }¶" }{ IF { MERGEFIELD "Product D" } <> "" "Product D : { MERGEFIELD "Product D" }¶" }

(the field bracket pairs are inserted with CTRL+F9). Press the enter key at ¶.

If there is a value in 'Product A' the field will produce 'Product A : 1%' followed by a paragraph break, otherwise it will do nothing. Similarly the other fields. Modify as required.

The only minor proviso relates to the percentage value in the data source. If necessary use a formatting switch to give the correct result - see http://www.gmayor.com/formatting_word_fields.htm
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 09-01-2015, 12:35 PM
Echevca Echevca is offline Mail Merge - List clients with different sets of products Windows 7 64bit Mail Merge - List clients with different sets of products Office 2010 64bit
Novice
Mail Merge - List clients with different sets of products
 
Join Date: Aug 2015
Posts: 3
Echevca is on a distinguished road
Default Thank you!

Thank you, thank you, thank you for you quick response during the weekend. I was having computer problems so I was unable to thank you right away.

It seemed to have worked with the products that had values listed one after the other on one line. I ventured into adding a ¶ after each product mergefield so that the products appear one over the other, but in doing so I get an empty row that I don't need/want...how do I get rid of those blank rows or how do I get the results to list without empty product lines?

This is the edited version for Products A-C taking your formula and adding the extra ¶

{ IF { MERGEFIELD "Product A" } <> "" "Product A : { MERGEFIELD "Product A" }¶" }¶{ IF { MERGEFIELD "Product B" } <> "" "Product B : { MERGEFIELD "Product B" }¶" }¶{ IF { MERGEFIELD "Product C" } <> "" "Product C : { MERGEFIELD "Product C" }¶" }¶

So right now I get the following look:


Product A #%

Product C #%
Product D #%


I want to eliminate that extra empty row that pertains to Product B (which didn't populate because it didn't have a value....which is what I wanted/needed)

Thanks in advance!
Reply With Quote
  #4  
Old 09-01-2015, 01:25 PM
Echevca Echevca is offline Mail Merge - List clients with different sets of products Windows 7 64bit Mail Merge - List clients with different sets of products Office 2010 64bit
Novice
Mail Merge - List clients with different sets of products
 
Join Date: Aug 2015
Posts: 3
Echevca is on a distinguished road
Default Insert a table ONLY if product D has a %

In addition, how do I insert a table ONLY when one of the products has information. So if Product D has a % in the data source then insert a table that will have three columns headers : Product, Current Price, New Price.

This table will only show when Product D has a % otherwise it will be "invisible".

The table will have 11 rows. Each of those "cells" will be conditioned "show" when Product D has a % in the data source.

Product Current Price New Price
Fee 1 $1.00 $2.00
Fee 2 $2.00 $3.00
Fee 3 $3.00 $4.00

Thanks again!!!!!
Reply With Quote
  #5  
Old 09-01-2015, 07:00 PM
macropod's Avatar
macropod macropod is offline Mail Merge - List clients with different sets of products Windows 7 64bit Mail Merge - List clients with different sets of products Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,343
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Echevca View Post
I have clients with different set of products. For simplicity purposes lets pretend the products are called A, B, C, D. Not all clients have all four products. Client #1, for example only has products A and B; Client#2 only has product B and Client #3 only has products C and D.

My Excel file will look like this:


Client Product A Product B Product C Product D
Client 1 1% 2%
Client 2 2%
Client 3 3% 4%

I want to put a letter together that reference the % increase each product will incur without having to list all four products as a template and avoid spaces between the lines when there is no product. For example. the letter for carriers #1 will say that they are getting an increase for products A and B while the letter for Carrier #2 will say they are getting an increase for product. B....they will not see the other products listed since they don't have a % marked in the Excel file.
Assuming you want lists like:

Client 1
Product A : %
Product C : %
Product D : %

Client 2
Product B : %
Product D : %

Client 3
Product A : %
Product B : %
Product C : %
Product D : %

you don't need IF tests! Try:
{MERGEFIELD Product_A \b "Product A : "}{MERGEFIELD Product_B \b "¶
Product B : "}{MERGEFIELD Product_C \b "¶
Product C : "}{MERGEFIELD Product_D \b "¶
Product D : "}¶
where ¶ is an actual paragraph break or line break.

To conditionally output a whole table row, though, you would need IF tests but, unless you want to make things very complicated (so as to account for every possible combination), your output will generate a series of one-row tables. The one-row table approach uses fields like:
|Product|Current Price|New Price|
{IF{MERGEFIELD Product_A}<> "|{MERGEFIELD Product_A}|{MERGEFIELD Current_Price_A}|{MERGEFIELD New_Price_A}|¶
"}{IF{MERGEFIELD Product_B}<> "|{MERGEFIELD Product_B}|{MERGEFIELD Current_Price_B}|{MERGEFIELD New_Price_B}|¶
"}
etc., where the | characters represent table cell borders.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
if/then/else, mail merge rule



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to stop including images as attachment (in other e-mail clients)? TylerSD Outlook 0 12-05-2014 01:56 PM
Mail Merge - List clients with different sets of products Grouping list in Mail Merge AlexTeslin Mail Merge 1 03-08-2013 09:31 PM
Mail Merge - List clients with different sets of products Mail Merge Recipients List TanMan Mail Merge 1 10-13-2011 06:36 PM
How to add to list of Style Sets oscarsonthepond Word 3 09-20-2011 03:15 PM
Personal folders of clients disappeared after changing mail server asiri85 Outlook 4 05-14-2011 06:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:14 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft