Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
mroshaw mroshaw is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mailmerge directories not working Word 2003 Chris Mailmerge 5 January 16th 07 01:41 PM
Mailmerge stoped working! ross Mailmerge 2 March 3rd 06 11:18 AM
Word 2000 Mailmerge not Working Ken Mailmerge 1 June 9th 05 08:41 PM
Statement parameter in Mailmerge.OpenDataSource Christof Nordiek Mailmerge 6 April 26th 05 09:31 AM
Using If statement in mailmerge document fig000 Mailmerge 3 March 31st 05 09:29 PM


All times are GMT +1. The time now is 09:43 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"