Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Tom Bean
 
Posts: n/a
Default Conditional Merge Problem

I am trying to create a document containing up to 30 items in a bulleted
list based on the value of MERGEFIELDs corresponding to each item but am
having problems getting the merge to work correctly.

An example of the list in my current document is:

{ IF { MERGEFIELD Field1 } "" "§ Value of Field1 is { MERGEFIELD
Field1 }Enter
" }{ IF { MERGEFIELD Field2 } "" "§ Text for Field2Enter
" }{ IF { MERGEFIELD Field3 } "" "§ Text for Field3Enter
" }{ IF { MERGEFIELD Field4 } "" "§ Value of Field4 is { MERGEFIELD
Field4 }Enter
" }Enter

where Enter indicates where the 'Enter' key is pressed resulting in a
paragraph mark.

I want the document merged using the above example to look like:

§ Value of Field1 is Value1
§ Text for Field2
§ Value of Field4 is Value4

where the data source has "Value1", "Y", "" and "Value4" in Field1, Field2,
Field3 and Field4 columns.

The first problem I encountered was with Bullets showing a blank line if the
condition was not True, hence the square symbol at the beginning of the
text.

After replacing Bullets with the square symbol, everything appeared to work
when all the merge fields had non-empty values. When the value for Field3
was empty, as in the above example, neither the line for Field3 or Field4
were displayed. From various data patterns I tried, the output stopped when
the first empty column was encountered.

Thinking the empty columns might be the problem, I tried putting "N" for the
value of the fields I didn't want displayed and changed the IF statement to
IF { MERGEFIELD Field1 } "N". Once again this resulted in unexpected
behavior, all the lines were displayed regardless of whether on not they
contained an "N" and after the first "N" was encountered, the values for
subsequent fields was not shown.

Obviously, I'm doing something wrong.

Can someone please tell me how to do this correctly?

Thanks,
Tom


  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor
 
Posts: n/a
Default Conditional Merge Problem

It works for me as you have it written - assuming § is your bullet
character.

{ IF{ Mergefield Field1 } "" "§ Value of Field1 is { Mergefield Field1 }
" }{ IF{ Mergefield Field2 } "" "§ Text for Field2
" }{ IF{ Mergefield Field3 } "" "§ Text for Field3
" }{ IF{ Mergefield Field4} "" "§ Text for Field4 is { Mergefield
Field4 }
" }

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Tom Bean wrote:
I am trying to create a document containing up to 30 items in a
bulleted list based on the value of MERGEFIELDs corresponding to each
item but am having problems getting the merge to work correctly.

An example of the list in my current document is:

{ IF { MERGEFIELD Field1 } "" "§ Value of Field1 is { MERGEFIELD
Field1 }Enter
" }{ IF { MERGEFIELD Field2 } "" "§ Text for Field2Enter
" }{ IF { MERGEFIELD Field3 } "" "§ Text for Field3Enter
" }{ IF { MERGEFIELD Field4 } "" "§ Value of Field4 is {
MERGEFIELD Field4 }Enter
" }Enter

where Enter indicates where the 'Enter' key is pressed resulting in
a paragraph mark.

I want the document merged using the above example to look like:

§ Value of Field1 is Value1
§ Text for Field2
§ Value of Field4 is Value4

where the data source has "Value1", "Y", "" and "Value4" in Field1,
Field2, Field3 and Field4 columns.

The first problem I encountered was with Bullets showing a blank line
if the condition was not True, hence the square symbol at the
beginning of the text.

After replacing Bullets with the square symbol, everything appeared
to work when all the merge fields had non-empty values. When the
value for Field3 was empty, as in the above example, neither the line
for Field3 or Field4 were displayed. From various data patterns I
tried, the output stopped when the first empty column was encountered.

Thinking the empty columns might be the problem, I tried putting "N"
for the value of the fields I didn't want displayed and changed the
IF statement to IF { MERGEFIELD Field1 } "N". Once again this
resulted in unexpected behavior, all the lines were displayed
regardless of whether on not they contained an "N" and after the
first "N" was encountered, the values for subsequent fields was not
shown.
Obviously, I'm doing something wrong.

Can someone please tell me how to do this correctly?

Thanks,
Tom



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Tom Bean
 
Posts: n/a
Default Conditional Merge Problem

Graham,

Everything is working fine now. All I did was close the document and the
data source and reopen them and everything worked. It seems like Word
wasn't seeing changes in the data source or got in some state where it
didn't work and reloading it fixed the problems. Is that normal?

Thanks,
Tom

"Graham Mayor" wrote in message
...
It works for me as you have it written - assuming § is your bullet
character.

{ IF{ Mergefield Field1 } "" "§ Value of Field1 is { Mergefield
Field1 }
" }{ IF{ Mergefield Field2 } "" "§ Text for Field2
" }{ IF{ Mergefield Field3 } "" "§ Text for Field3
" }{ IF{ Mergefield Field4} "" "§ Text for Field4 is { Mergefield
Field4 }
" }

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Tom Bean wrote:
I am trying to create a document containing up to 30 items in a
bulleted list based on the value of MERGEFIELDs corresponding to each
item but am having problems getting the merge to work correctly.

An example of the list in my current document is:

{ IF { MERGEFIELD Field1 } "" "§ Value of Field1 is { MERGEFIELD
Field1 }Enter
" }{ IF { MERGEFIELD Field2 } "" "§ Text for Field2Enter
" }{ IF { MERGEFIELD Field3 } "" "§ Text for Field3Enter
" }{ IF { MERGEFIELD Field4 } "" "§ Value of Field4 is {
MERGEFIELD Field4 }Enter
" }Enter

where Enter indicates where the 'Enter' key is pressed resulting in
a paragraph mark.

I want the document merged using the above example to look like:

§ Value of Field1 is Value1
§ Text for Field2
§ Value of Field4 is Value4

where the data source has "Value1", "Y", "" and "Value4" in Field1,
Field2, Field3 and Field4 columns.

The first problem I encountered was with Bullets showing a blank line
if the condition was not True, hence the square symbol at the
beginning of the text.

After replacing Bullets with the square symbol, everything appeared
to work when all the merge fields had non-empty values. When the
value for Field3 was empty, as in the above example, neither the line
for Field3 or Field4 were displayed. From various data patterns I
tried, the output stopped when the first empty column was encountered.

Thinking the empty columns might be the problem, I tried putting "N"
for the value of the fields I didn't want displayed and changed the
IF statement to IF { MERGEFIELD Field1 } "N". Once again this
resulted in unexpected behavior, all the lines were displayed
regardless of whether on not they contained an "N" and after the
first "N" was encountered, the values for subsequent fields was not
shown.
Obviously, I'm doing something wrong.

Can someone please tell me how to do this correctly?

Thanks,
Tom





  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor
 
Posts: n/a
Default Conditional Merge Problem

You shouldn't have to re-attach the data file following changes, but you do
have to save the changes! Still as long as it works .......

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Tom Bean wrote:
Graham,

Everything is working fine now. All I did was close the document and
the data source and reopen them and everything worked. It seems like
Word wasn't seeing changes in the data source or got in some state
where it didn't work and reloading it fixed the problems. Is that
normal?
Thanks,
Tom

"Graham Mayor" wrote in message
...
It works for me as you have it written - assuming § is your bullet
character.

{ IF{ Mergefield Field1 } "" "§ Value of Field1 is { Mergefield
Field1 }
" }{ IF{ Mergefield Field2 } "" "§ Text for Field2
" }{ IF{ Mergefield Field3 } "" "§ Text for Field3
" }{ IF{ Mergefield Field4} "" "§ Text for Field4 is {
Mergefield Field4 }
" }

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Tom Bean wrote:
I am trying to create a document containing up to 30 items in a
bulleted list based on the value of MERGEFIELDs corresponding to
each item but am having problems getting the merge to work
correctly. An example of the list in my current document is:

{ IF { MERGEFIELD Field1 } "" "§ Value of Field1 is { MERGEFIELD
Field1 }Enter
" }{ IF { MERGEFIELD Field2 } "" "§ Text for Field2Enter
" }{ IF { MERGEFIELD Field3 } "" "§ Text for Field3Enter
" }{ IF { MERGEFIELD Field4 } "" "§ Value of Field4 is {
MERGEFIELD Field4 }Enter
" }Enter

where Enter indicates where the 'Enter' key is pressed resulting
in a paragraph mark.

I want the document merged using the above example to look like:

§ Value of Field1 is Value1
§ Text for Field2
§ Value of Field4 is Value4

where the data source has "Value1", "Y", "" and "Value4" in Field1,
Field2, Field3 and Field4 columns.

The first problem I encountered was with Bullets showing a blank
line if the condition was not True, hence the square symbol at the
beginning of the text.

After replacing Bullets with the square symbol, everything appeared
to work when all the merge fields had non-empty values. When the
value for Field3 was empty, as in the above example, neither the
line for Field3 or Field4 were displayed. From various data
patterns I tried, the output stopped when the first empty column
was encountered. Thinking the empty columns might be the problem, I
tried putting "N"
for the value of the fields I didn't want displayed and changed the
IF statement to IF { MERGEFIELD Field1 } "N". Once again this
resulted in unexpected behavior, all the lines were displayed
regardless of whether on not they contained an "N" and after the
first "N" was encountered, the values for subsequent fields was not
shown.
Obviously, I'm doing something wrong.

Can someone please tell me how to do this correctly?

Thanks,
Tom



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
Insert Merge Field problem with Word-Mail Merge from Excel documen Augusta E. Microsoft Word Help 2 June 20th 05 10:59 AM
Mail merge data source problem campwes Mailmerge 1 January 25th 05 07:16 PM
complex conditional merge Walter Mailmerge 0 January 9th 05 12:49 AM
Mail Merge Problem Cindy M -WordMVP- Mailmerge 0 November 30th 04 05:25 PM
Conditional mail merge Hanif Mailmerge 1 November 26th 04 07:10 PM


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