Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Word MailMerge IF statement not working with hyphens
Hi!
First up, I'm using Microsoft Word 2003 (11.6359.6360 SP1) on Windows XP Professional SP2. I have an external data source which supplies a field to a Word Mail Merge template, detailing how a Customer made contact. The field can have the following values: Call - Inbound Email - Inbound Internet Fax If have a block of code to personalise the greeting: Thank you for contacting us { IF { MERGEFIELD "CONTACT_TYPE" "Internet" "via our website." } IF { { MERGEFIELD "CONTACT_TYPE" = "Call - Inbound" "via telephone." } IF { { MERGEFIELD "CONTACT_TYPE" = "Fax" "via fax." "" } } } This works fine for 'Internet' and 'Fax' but not for 'Call - Inbound' or 'Email - Inbound'. I suspect the issue is with comparing the hyphen, but I can't figure out how to resolve this. I've turned off Autocorrection and pasted the value directly from the data source into the Word document but still no luck. I can display the field value on it's own without any issue. Any ideas? Many thanks for any responses! |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Word MailMerge IF statement not working with hyphens
That should be
Thank you for contacting us { IF { MERGEFIELD "CONTACT_TYPE" } = "Internet" "via our website." ""}{ IF { MERGEFIELD "CONTACT_TYPE" }= "Call - Inbound" "via telephone." ""}{ IF { MERGEFIELD "CONTACT_TYPE" } = "Fax" "via fax." "" }{ IF { MERGEFIELD "CONTACT_TYPE" } = "Email - Inbound" "via Email." "" } or it could be nested. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "mroshaw" wrote in message ... Hi! First up, I'm using Microsoft Word 2003 (11.6359.6360 SP1) on Windows XP Professional SP2. I have an external data source which supplies a field to a Word Mail Merge template, detailing how a Customer made contact. The field can have the following values: Call - Inbound Email - Inbound Internet Fax If have a block of code to personalise the greeting: Thank you for contacting us { IF { MERGEFIELD "CONTACT_TYPE" "Internet" "via our website." } IF { { MERGEFIELD "CONTACT_TYPE" = "Call - Inbound" "via telephone." } IF { { MERGEFIELD "CONTACT_TYPE" = "Fax" "via fax." "" } } } This works fine for 'Internet' and 'Fax' but not for 'Call - Inbound' or 'Email - Inbound'. I suspect the issue is with comparing the hyphen, but I can't figure out how to resolve this. I've turned off Autocorrection and pasted the value directly from the data source into the Word document but still no luck. I can display the field value on it's own without any issue. Any ideas? Many thanks for any responses! |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Mailmerge directories not working Word 2003 | Mailmerge | |||
Mailmerge stoped working! | Mailmerge | |||
Word 2000 Mailmerge not Working | Mailmerge | |||
Statement parameter in Mailmerge.OpenDataSource | Mailmerge | |||
Using If statement in mailmerge document | Mailmerge |