Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
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 | |
|
|
![]() |
||||
Thread | Forum | |||
Insert Merge Field problem with Word-Mail Merge from Excel documen | Microsoft Word Help | |||
Mail merge data source problem | Mailmerge | |||
complex conditional merge | Mailmerge | |||
Mail Merge Problem | Mailmerge | |||
Conditional mail merge | Mailmerge |