Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Alex Hammerstein Alex Hammerstein is offline
external usenet poster
 
Posts: 18
Default IfThenElse in a mailmerge

Hi, I am trying to create an ITE in my mailmerge.

I have two fields: Title and Gender.

I am trying to create an ITE statement which effectively says: If Title is
Blank and gender = male then Mr, else if Title is Blank and gender = Female
then Ms, else Title.

I don't seem to be able to get it right. Can someone help please

Tks

A

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default IfThenElse in a mailmerge

Something like

{ IF "{ MERGEFIELD Title }" = ""
"{ IF "{ MERGEFIELD gender \*Upper }" = "MALE"
"Mr"
"{ IF "{ MERGEFIELD gender \*Upper }" = "FEMALE"
"Ms"
"(if you need something special when title is blank and it's neither
male nor female, put it here)" }" "{ MERGEFIELD Title }" }

where all the pairs of {} are the special field braces you can insert
using ctrl-F9, and all the above can be on one line if you like.

Peter Jamieson

http://tips.pjmsn.me.uk

Alex Hammerstein wrote:
Hi, I am trying to create an ITE in my mailmerge.

I have two fields: Title and Gender.

I am trying to create an ITE statement which effectively says: If Title is
Blank and gender = male then Mr, else if Title is Blank and gender = Female
then Ms, else Title.

I don't seem to be able to get it right. Can someone help please

Tks

A

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default IfThenElse in a mailmerge

Hi Alex,

A slightly simpler code:
{IF{MERGEFIELD Title} "" {MERGEFIELD Title} {IF{MERGEFIELD Gender \* Caps}= "M*" Mr Ms}}
Note: this doesn't provide for a default output if both the title and gender are empty.


--
Cheers
macropod
[Microsoft MVP - Word]


"Alex Hammerstein" wrote in message ...
Hi, I am trying to create an ITE in my mailmerge.

I have two fields: Title and Gender.

I am trying to create an ITE statement which effectively says: If Title is
Blank and gender = male then Mr, else if Title is Blank and gender = Female
then Ms, else Title.

I don't seem to be able to get it right. Can someone help please

Tks

A

  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Alex Hammerstein Alex Hammerstein is offline
external usenet poster
 
Posts: 18
Default IfThenElse in a mailmerge

Thanks Peter

Alex


On 19/05/2009 19:41, in article , "Peter
Jamieson" wrote:

Something like

{ IF "{ MERGEFIELD Title }" = ""
"{ IF "{ MERGEFIELD gender \*Upper }" = "MALE"
"Mr"
"{ IF "{ MERGEFIELD gender \*Upper }" = "FEMALE"
"Ms"
"(if you need something special when title is blank and it's neither
male nor female, put it here)" }" "{ MERGEFIELD Title }" }

where all the pairs of {} are the special field braces you can insert
using ctrl-F9, and all the above can be on one line if you like.

Peter Jamieson

http://tips.pjmsn.me.uk

Alex Hammerstein wrote:
Hi, I am trying to create an ITE in my mailmerge.

I have two fields: Title and Gender.

I am trying to create an ITE statement which effectively says: If Title is
Blank and gender = male then Mr, else if Title is Blank and gender = Female
then Ms, else Title.

I don't seem to be able to get it right. Can someone help please

Tks

A


  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Alex Hammerstein Alex Hammerstein is offline
external usenet poster
 
Posts: 18
Default IfThenElse in a mailmerge

Thanks

Alex
\


On 20/05/2009 01:26, in article ,
"macropod" wrote:

Hi Alex,

A slightly simpler code:
{IF{MERGEFIELD Title} "" {MERGEFIELD Title} {IF{MERGEFIELD Gender \* Caps}=
"M*" Mr Ms}}
Note: this doesn't provide for a default output if both the title and gender
are empty.


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 Nancy Mailmerge 1 August 7th 08 08:26 PM
Field Symbol in Ifthenelse Jack Lamberton Mailmerge 3 April 14th 08 07:03 AM
MailMerge and VBA User[_2_] New Users 3 December 18th 07 04:58 AM
mailmerge cookie Mailmerge 8 September 25th 07 06:46 PM
mailmerge? mojtaba aghili Mailmerge 2 July 24th 05 03:17 AM


All times are GMT +1. The time now is 11:28 PM.

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"