Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
gilbertj gilbertj is offline
external usenet poster
 
Posts: 1
Default Multiple criteria for mergefield

I have a spreadsheet as a data source. The data in each field is either a Y
or N. There could be more than one Yes for a record.

A B C D E
1 Y N N N N
2 N Y N N N
3 Y Y N N N
etc

In my merge document, I want to place an embedded object in a table cell
depending on the criteria in the spreadsheet: { If { mergefield A } = "Y" "
{EMBED Word.Picture.8 }" }

In addition, I would also like to place a different embedded object if A=N
and B=Y in the same cell in merge document.
If A=Y and B=Y, then I would like to place an embedded object in the first
cell in the merge document and a new embedded object in another cell in the
merge document.

I hope there's some programming language using the "if then" statements.

Thanks
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Multiple criteria for mergefield

{ IF { MERGEFIELD A } = "Y" { INCLUDEPICTURE "DRIVE:\\PATH\\FILENAME" } { IF
{ MERGEFIELD B = "Y" { INCLUDEPICTURE "DRIVE:\\PATH\\ANOTHERFILENAME" }
"" } }

You need to use Ctrl+F9 to insert the field delimiters { } and Alt+F9 to
toggle the display of field codes and F9 to update the fields.

See the "Graphics from data base" item under the "Special merges" section of
fellow MVP Cindy Meister's website at

http://homepage.swissonline.ch/cindy...r/MergFram.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"gilbertj" u23713@uwe wrote in message news:62b4c4c1f7074@uwe...
I have a spreadsheet as a data source. The data in each field is either a
Y
or N. There could be more than one Yes for a record.

A B C D E
1 Y N N N N
2 N Y N N N
3 Y Y N N N
etc

In my merge document, I want to place an embedded object in a table cell
depending on the criteria in the spreadsheet: { If { mergefield A } = "Y"
"
{EMBED Word.Picture.8 }" }

In addition, I would also like to place a different embedded object if A=N
and B=Y in the same cell in merge document.
If A=Y and B=Y, then I would like to place an embedded object in the first
cell in the merge document and a new embedded object in another cell in
the
merge document.

I hope there's some programming language using the "if then" statements.

Thanks



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Multiple criteria for mergefield

Hmmm.... IncludePicture fields do not usually work when included as a
conditional field result. The IncludePicture field has to be at the top of
the tree - see the workaround at
http://www.gmayor.com/formatting_word_fields.htm#image

--

Graham Mayor - Word MVP

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


Doug Robbins - Word MVP wrote:
{ IF { MERGEFIELD A } = "Y" { INCLUDEPICTURE "DRIVE:\\PATH\\FILENAME"
} { IF { MERGEFIELD B = "Y" { INCLUDEPICTURE
"DRIVE:\\PATH\\ANOTHERFILENAME" } "" } }

You need to use Ctrl+F9 to insert the field delimiters { } and Alt+F9
to toggle the display of field codes and F9 to update the fields.

See the "Graphics from data base" item under the "Special merges"
section of fellow MVP Cindy Meister's website at

http://homepage.swissonline.ch/cindy...r/MergFram.htm



"gilbertj" u23713@uwe wrote in message news:62b4c4c1f7074@uwe...
I have a spreadsheet as a data source. The data in each field is
either a Y
or N. There could be more than one Yes for a record.

A B C D E
1 Y N N N N
2 N Y N N N
3 Y Y N N N
etc

In my merge document, I want to place an embedded object in a table
cell depending on the criteria in the spreadsheet: { If {
mergefield A } = "Y" "
{EMBED Word.Picture.8 }" }

In addition, I would also like to place a different embedded object
if A=N and B=Y in the same cell in merge document.
If A=Y and B=Y, then I would like to place an embedded object in the
first cell in the merge document and a new embedded object in
another cell in the
merge document.

I hope there's some programming language using the "if then"
statements. Thanks



  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Multiple criteria for mergefield

Luckily, in this case the inclusions are { EMBED } fields and wrapping IF
fields around them seems to work OK, although it wouldn't surprise me if
some types of object embedded OK and others did not, particularly in a table
cell.

Spelling out the field codes isn't quite so clear because EMBED codes for a
particular type of object all look the same, e.g. in this case I think the
user would need

{ IF "[ MERGEFIELD A }" = "Y" "{ IF { MERGEFIELD B }" = "Y" "{ EMBED
Word.Picture.8 }" "{ EMBED Word.Picture.8 }" }" "{ EMBED Word.Picture.8 }" }

in the first cell and perhaps

{ IF "[ MERGEFIELD A }{ MERGEFIELD B }" = "YY" "{ EMBED Word.Picture.8 }"
"" }

in "another cell", depending on what the actual requirement is. I don't know
of a way to get the correct EMBEDs in the correct places other either
a. doing the embed, displaying the IF field using Alt-F9, and
copying/pasting the EMBED into the correct part of the IF field or
b. (maybe) putting the insertion point in the correct part of the IF and
doing the embed there.

Peter Jamieson

"Graham Mayor" wrote in message
...
Hmmm.... IncludePicture fields do not usually work when included as a
conditional field result. The IncludePicture field has to be at the top of
the tree - see the workaround at
http://www.gmayor.com/formatting_word_fields.htm#image

--

Graham Mayor - Word MVP

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


Doug Robbins - Word MVP wrote:
{ IF { MERGEFIELD A } = "Y" { INCLUDEPICTURE "DRIVE:\\PATH\\FILENAME"
} { IF { MERGEFIELD B = "Y" { INCLUDEPICTURE
"DRIVE:\\PATH\\ANOTHERFILENAME" } "" } }

You need to use Ctrl+F9 to insert the field delimiters { } and Alt+F9
to toggle the display of field codes and F9 to update the fields.

See the "Graphics from data base" item under the "Special merges"
section of fellow MVP Cindy Meister's website at

http://homepage.swissonline.ch/cindy...r/MergFram.htm



"gilbertj" u23713@uwe wrote in message news:62b4c4c1f7074@uwe...
I have a spreadsheet as a data source. The data in each field is
either a Y
or N. There could be more than one Yes for a record.

A B C D E
1 Y N N N N
2 N Y N N N
3 Y Y N N N
etc

In my merge document, I want to place an embedded object in a table
cell depending on the criteria in the spreadsheet: { If {
mergefield A } = "Y" "
{EMBED Word.Picture.8 }" }

In addition, I would also like to place a different embedded object
if A=N and B=Y in the same cell in merge document.
If A=Y and B=Y, then I would like to place an embedded object in the
first cell in the merge document and a new embedded object in
another cell in the
merge document.

I hope there's some programming language using the "if then"
statements. Thanks





  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Multiple criteria for mergefield

I think that the last part of your comment suggests as good a reason as any
to use Includepicture fields rather than attempt to embed the pictures in
the appropriate place.

--

Graham Mayor - Word MVP

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


Peter Jamieson wrote:
Luckily, in this case the inclusions are { EMBED } fields and
wrapping IF fields around them seems to work OK, although it wouldn't
surprise me if some types of object embedded OK and others did not,
particularly in a table cell.

Spelling out the field codes isn't quite so clear because EMBED codes
for a particular type of object all look the same, e.g. in this case
I think the user would need

{ IF "[ MERGEFIELD A }" = "Y" "{ IF { MERGEFIELD B }" = "Y" "{ EMBED
Word.Picture.8 }" "{ EMBED Word.Picture.8 }" }" "{ EMBED
Word.Picture.8 }" }
in the first cell and perhaps

{ IF "[ MERGEFIELD A }{ MERGEFIELD B }" = "YY" "{ EMBED
Word.Picture.8 }" "" }

in "another cell", depending on what the actual requirement is. I
don't know of a way to get the correct EMBEDs in the correct places
other either a. doing the embed, displaying the IF field using Alt-F9, and
copying/pasting the EMBED into the correct part of the IF field or
b. (maybe) putting the insertion point in the correct part of the IF
and doing the embed there.

Peter Jamieson

"Graham Mayor" wrote in message
...
Hmmm.... IncludePicture fields do not usually work when included as a
conditional field result. The IncludePicture field has to be at the
top of the tree - see the workaround at
http://www.gmayor.com/formatting_word_fields.htm#image

--

Graham Mayor - Word MVP

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


Doug Robbins - Word MVP wrote:
{ IF { MERGEFIELD A } = "Y" { INCLUDEPICTURE
"DRIVE:\\PATH\\FILENAME" } { IF { MERGEFIELD B = "Y" {
INCLUDEPICTURE "DRIVE:\\PATH\\ANOTHERFILENAME" } "" } }

You need to use Ctrl+F9 to insert the field delimiters { } and
Alt+F9 to toggle the display of field codes and F9 to update the
fields. See the "Graphics from data base" item under the "Special
merges"
section of fellow MVP Cindy Meister's website at

http://homepage.swissonline.ch/cindy...r/MergFram.htm



"gilbertj" u23713@uwe wrote in message news:62b4c4c1f7074@uwe...
I have a spreadsheet as a data source. The data in each field is
either a Y
or N. There could be more than one Yes for a record.

A B C D E
1 Y N N N N
2 N Y N N N
3 Y Y N N N
etc

In my merge document, I want to place an embedded object in a table
cell depending on the criteria in the spreadsheet: { If {
mergefield A } = "Y" "
{EMBED Word.Picture.8 }" }

In addition, I would also like to place a different embedded object
if A=N and B=Y in the same cell in merge document.
If A=Y and B=Y, then I would like to place an embedded object in
the first cell in the merge document and a new embedded object in
another cell in the
merge document.

I hope there's some programming language using the "if then"
statements. Thanks



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
counting for a sum w/ multiple criteria Michelle D via OfficeKB.com Mailmerge 2 December 14th 05 10:31 AM
Problem with Advanced selection Criteria JR Hester Mailmerge 2 November 3rd 05 07:24 PM
text with multiple fonts inserted into document with multiple columns? [email protected] New Users 4 July 22nd 05 01:45 AM
Use drop down lists to select specific criteria Diggles1972 Microsoft Word Help 1 July 16th 05 10:12 AM
Multiple docs open multiple words Ron Smith New Users 2 December 11th 04 09:21 PM


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