Mail merge with multiple conditions

Enaxor18 Posted messages 23 Registration date   Status Membre Last intervention   -  
tyranausor Posted messages 3501 Registration date   Status Membre Last intervention   -
Hello!

After several searches on various forums and topics, I'm reaching out to you because I haven't found a solution to my problem...

I would like to perform a mail merge with several conditions. My tools: Word 2010 and Excel 2010

My Excel data:
Column A "Invoice Destination":
France
EU
Non-EU

Column B "Language":
French
English

What I would like to achieve:
France + French = nothing
France + English = nothing
EU + French = VAT due by the buyer
EU + English = VAT is payable by the customer
Non-EU + French = VAT exemption
Non-EU + English = VAT exemption

I can formulate all of this in Excel:
=IF(AND(A2="France",B2="Français")," ",IF(AND(A2="France",B2="English")," ",IF(AND(A2="EU",B2="Français"),"VAT due by the buyer",IF(AND(A2="EU",B2="English"),"VAT is payable by the customer...",IF(AND(A2="Non-EU",B2="Français"),"VAT exemption",IF(AND(A2="Non-EU",B2="English"),"VAT exemption...","ERROR"))))))

But I want (imperatively) the conditions to be made in my Word document (so it's useless to tell me that I can handle the condition in Excel :) )

Could you help me write the conditions in Word? I'm open to a VBA solution, but you'll need to guide me step by step, as I have only minimal knowledge in that area...

Thank you in advance for your help! :D
Enaxor18

2 réponses

m@rina Posted messages 27234 Registration date   Status Modérateur Last intervention   11 543
 
Hello,

The multiple conditions are much easier to manage with Excel.
For Word, you need to know how to manipulate fields. I explain here:
https://faqword.com/index.php/word/publipostage/286-dans-un-document-de-publipostage-je-voudrais-pouvoir-faire-un-et-logique-avec-deux-criteres
You need several fields one after the other for each pair of conditions.
I remind you that ALL the { } are obtained with Ctrl+F9.

m@rina

--
It's useless to ask me your questions privately. I won't answer them.
2
tyranausor Posted messages 3501 Registration date   Status Membre Last intervention   2 060
 
Hello, thank you for the explanation about the fields, I didn't know that either and there are very few sites on it!
0