Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
joe925c joe925c is offline
external usenet poster
 
Posts: 19
Default Merge Logic Functions

Word 2007 Windows XP Home.

Recipient List
Merged Output Desired
First Name M First Name F Surname
Jim Fir
Jim Fir
Joan Beech
Joan Beech
Pine
Pine
Paul Dianne Oak
Paul and Dianne Oak

Basically want IF {First Name M} AND {First Name F} ARE not blank then PRINT
{{First Name M} and {First Name F}} ELSE PRINT {First Name M}{ First Name F}

Have tried to work with the IF..THEN..ELSE "rule" including nesting IFs but
no luck. Any solutions?

  #2   Report Post  
Posted to microsoft.public.word.newusers
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Merge Logic Functions

Hi joe925c,

You could code your field as:
{IF{IF{MERGEFIELD First_Name_M} "" 1 0}+{IF{MERGEFIELD First_Name_F} "" 1 0}= 2 "{MERGEFIELD First_Name_M} and {MERGEFIELD
First_Name_F} "{MERGEFIELD First_Name_M}{MERGEFIELD First_Name_M}"}

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[MVP - Microsoft Word]


"joe925c" wrote in message ...
Word 2007 Windows XP Home.

Recipient List
Merged Output Desired
First Name M First Name F Surname
Jim Fir
Jim Fir
Joan Beech
Joan Beech
Pine
Pine
Paul Dianne Oak
Paul and Dianne Oak

Basically want IF {First Name M} AND {First Name F} ARE not blank then PRINT
{{First Name M} and {First Name F}} ELSE PRINT {First Name M}{ First Name F}

Have tried to work with the IF..THEN..ELSE "rule" including nesting IFs but
no luck. Any solutions?


  #3   Report Post  
Posted to microsoft.public.word.newusers
joe925c joe925c is offline
external usenet poster
 
Posts: 19
Default Merge Logic Functions

macropod,

Thanks for your response. Where can I find all the logic functions
available? I used help and spent some time online at the Microsoft help
series and even have the "Microsoft Office 2007 Bible" and no mention of the
logic functions that I could find.

I gather that you put the DO and ElSE data in quotes. I had thought that you
only did that if the data was pure text. Makes sense or would be unable to
determine the two strings. In this regard, below is the last series of data
from your suggested solution.

First_Name_F} "{MERGEFIELD First_Name_M}{MERGEFIELD First_Name_M}"}

Is there a missing quote mark after the First_Name_F}? That point would be
the end of the DO string.

"macropod" wrote:

Hi joe925c,

You could code your field as:
{IF{IF{MERGEFIELD First_Name_M} "" 1 0}+{IF{MERGEFIELD First_Name_F} "" 1 0}= 2 "{MERGEFIELD First_Name_M} and {MERGEFIELD
First_Name_F} "{MERGEFIELD First_Name_M}{MERGEFIELD First_Name_M}"}

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[MVP - Microsoft Word]


"joe925c" wrote in message ...
Word 2007 Windows XP Home.

Recipient List
Merged Output Desired
First Name M First Name F Surname
Jim Fir
Jim Fir
Joan Beech
Joan Beech
Pine
Pine
Paul Dianne Oak
Paul and Dianne Oak

Basically want IF {First Name M} AND {First Name F} ARE not blank then PRINT
{{First Name M} and {First Name F}} ELSE PRINT {First Name M}{ First Name F}

Have tried to work with the IF..THEN..ELSE "rule" including nesting IFs but
no luck. Any solutions?



  #4   Report Post  
Posted to microsoft.public.word.newusers
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Merge Logic Functions

Hi joe925c,

It seems a doub;e-quote got lost somewhere along the line. The coding should have been:
{IF{IF{MERGEFIELD First_Name_M} "" 1 0}+{IF{MERGEFIELD First_Name_F} "" 1 0}= 2 "{MERGEFIELD First_Name_M} and {MERGEFIELD
First_Name_F}" "{MERGEFIELD First_Name_M}{MERGEFIELD First_Name_M}"}

Alternatively, one could use:
{MERGEFIELD First_Name_M}{IF{IF{MERGEFIELD First_Name_M} "" 1 0}+{IF{MERGEFIELD First_Name_F} "" 1 0}= 2 " and " ""}{MERGEFIELD
First_Name_M}

The logic in the IF test is something I developed myself. I can't recall anything from MS discussing anything similar. You'll see
the above technique and a variety of other field manipulations demonstrated in my Word Field Maths 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=365442
or
http://www.gmayor.com/downloads.htm#Third_party

--
Cheers
macropod
[MVP - Microsoft Word]


"joe925c" wrote in message ...
macropod,

Thanks for your response. Where can I find all the logic functions
available? I used help and spent some time online at the Microsoft help
series and even have the "Microsoft Office 2007 Bible" and no mention of the
logic functions that I could find.

I gather that you put the DO and ElSE data in quotes. I had thought that you
only did that if the data was pure text. Makes sense or would be unable to
determine the two strings. In this regard, below is the last series of data
from your suggested solution.

First_Name_F} "{MERGEFIELD First_Name_M}{MERGEFIELD First_Name_M}"}

Is there a missing quote mark after the First_Name_F}? That point would be
the end of the DO string.

"macropod" wrote:

Hi joe925c,

You could code your field as:
{IF{IF{MERGEFIELD First_Name_M} "" 1 0}+{IF{MERGEFIELD First_Name_F} "" 1 0}= 2 "{MERGEFIELD First_Name_M} and {MERGEFIELD
First_Name_F} "{MERGEFIELD First_Name_M}{MERGEFIELD First_Name_M}"}

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[MVP - Microsoft Word]


"joe925c" wrote in message ...
Word 2007 Windows XP Home.

Recipient List
Merged Output Desired
First Name M First Name F Surname
Jim Fir
Jim Fir
Joan Beech
Joan Beech
Pine
Pine
Paul Dianne Oak
Paul and Dianne Oak

Basically want IF {First Name M} AND {First Name F} ARE not blank then PRINT
{{First Name M} and {First Name F}} ELSE PRINT {First Name M}{ First Name F}

Have tried to work with the IF..THEN..ELSE "rule" including nesting IFs but
no luck. Any solutions?




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
If Then Else with mail merge faulty logic? [email protected] Mailmerge 1 September 11th 07 06:58 PM
Syntax for performing arithmetic functions on merge fields. Lambs Mailmerge 1 November 29th 05 04:32 AM
Go To [Page Number] Logic? Paul Formatting Long Documents 6 November 27th 05 11:46 PM
Check Box Logic Eleanor Mailmerge 1 September 22nd 05 09:40 PM
Fuzzy logic matching in a DLL Dave Williams Microsoft Word Help 3 March 23rd 05 04:52 AM


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