Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Date & Text format in Mail merge

{{IF "{MERGEFIELD Type}"="E" "email"} {IF "{MERGEFIELD Type}"="L"
"letter"}

This looks as if it is wrapped in an extra pair of field braces (i.e. it
is probably actually something more like

{{IF "{MERGEFIELD Type}"="E" "email"} {IF "{MERGEFIELD Type}"="L" "letter"}}

which will display nothing.

However, you had the right idea as

{IF "{MERGEFIELD Type}" = "E" "email"} {IF "{MERGEFIELD Type}" = "L"
"letter"}

should do it.

{IF "{MERGEFIELD Type}"="E" "email" "="L" "letter"}


The syntax is basically

{ IF operand1 operator operand2 true-result false-result }
or
{ IF operand1 operator operand2 true-result }

so the above would not work: you can nest, but typically you have to
spell things out, e.g.

{ IF "{ MERGEFIELD Type }" = "E" "email" "{ IF "{ MERGEFIELD Type }" =
"L" "letter" }" "something else" }

(It's advisable to put double-quotes around text operators but in many
situations they are not strictly essential)

See Graham Mayor's page at

http://www.gmayor.com/formatting_word_fields.htm

for other handy info. - I'd suggest you browse through

http://www.gmayor.com/Word_pages.htm




Peter Jamieson

http://tips.pjmsn.me.uk

On 25/03/2010 13:08, Andy Roberts wrote:
Peter

On a similar theme I presume I can use the IF command to check for different
values and replace accordingly. For exapmple one of my merge fields called
TYPE contains either E, L or F (email, letter, fax)

Thinking about it I presume I can insert the TYPE filed into a sentence
(e.g. "thank you for your "TYPE" ... but replace the relevant letter with a
piece of text (i.e. "thank you for your E" would become "thank you for your
email"...

The code im using is

{IF "{MERGEFIELD Type}"="E" "email" "="L" "letter"}

This only deals with the first replacement (i.e. the E)

I've also tried

{{IF "{MERGEFIELD Type}"="E" "email"} {IF "{MERGEFIELD Type}"="L" "letter"}

but I get nothing at all when I use this. I've learnt loads this morning
playing with this and I presume the problem is simply my syntax (and my lack
of knowledge!)


 
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
Mail merge - date format Abhijitp Mailmerge 1 January 6th 09 02:58 PM
Mail merge date format Pieter van der Walt Microsoft Word Help 1 July 25th 08 02:37 PM
Mail Merge Date Format whiter Microsoft Word Help 4 December 14th 07 08:20 PM
Mail Merge Date Format Betty Microsoft Word Help 1 October 13th 06 06:02 AM
Mail Merge - Date Format Kilinski Microsoft Word Help 0 December 7th 04 01:13 PM


All times are GMT +1. The time now is 11:35 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"