Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
I have a mail merge where I want to eliminate printing a field if it
contains a particular value. But I still want to print the record. It's just the field I want to skip. Can anyone suggest how to do this? Thanks! Myrna |
#2
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
You use an IF field. For example, if you don't want to print the value of a
field called myfield when it is "M", use { IF "{ MERGEFIELD myfield }" = "M" "" "{ MERGEFIELD myfield }" } All the special {} pairs can be entered using ctrl-F9. Everything else is plain text you can type. Peter Jamieson wrote in message ups.com... I have a mail merge where I want to eliminate printing a field if it contains a particular value. But I still want to print the record. It's just the field I want to skip. Can anyone suggest how to do this? Thanks! Myrna |
#3
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Thanks, this sounds good. Now one more question - how do I do this if I
want to say 'don't print this field if it contains the word "blank" ' |
#4
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
I guess I need more help than I thought - where do I put the IF
statement? I thought it would go on the mail merge document but that doesn't seem to work. |
#5
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Sorry if I misunderstood - you can't do a test using simple fields for 'this
field's text contains the word "blank"' unless you happen to know that "blank" is at the beginning or end of the text. You may be able to do that a. in the data source before you merge, or b. using a DATABASE field if the data source uses a suitable dialect of SQL (it is difficult to recommend this approach anyway) c. using VBA and Word's mailmerge events to examine the content of the field before each record is merged. Peter Jamieson wrote in message oups.com... Thanks, this sounds good. Now one more question - how do I do this if I want to say 'don't print this field if it contains the word "blank" ' |
#6
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
It does, but if you need to detect the word "blank" anywhere in the mere
field text, it won't work, sorry. Peter Jamieson wrote in message oups.com... I guess I need more help than I thought - where do I put the IF statement? I thought it would go on the mail merge document but that doesn't seem to work. |
#7
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
I looked at doing it in the select but this will delete the records
having the word 'blank'. I'm not sure how to say that I want to keep the record but clear the field for this merge. Any thoughts? |
#8
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
You could use an expression in the SELECT to create another field, e.g. in
Jet SQL, something like SELECT iif(instr(myfield,'blank',1) = 0, myfield, '') AS 'mynewfield', * FROM .... (My syntax probably isn't quite right there) Peter Jamieson wrote in message oups.com... I looked at doing it in the select but this will delete the records having the word 'blank'. I'm not sure how to say that I want to keep the record but clear the field for this merge. Any thoughts? |
#9
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
You could use an expression in the SELECT to create another field, e.g. in
Jet SQL, something like SELECT iif(instr(myfield,'blank',1) = 0, myfield, '') AS 'mynewfield', * FROM .... (My syntax probably isn't quite right there) Peter Jamieson wrote in message oups.com... I looked at doing it in the select but this will delete the records having the word 'blank'. I'm not sure how to say that I want to keep the record but clear the field for this merge. Any thoughts? |
#10
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Can we clarify what is in this field? Does it contain just the word 'blank'
or does it contain 'blank' and some other text? Are you merging just that field? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org wrote: I looked at doing it in the select but this will delete the records having the word 'blank'. I'm not sure how to say that I want to keep the record but clear the field for this merge. Any thoughts? |
#11
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
The field contains a statement "This field intentionally left blank". I
am merging many fields and this is just one of them. I don't want to skip the record, I just want to print nothing if this is in the field. Myrna |
#12
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Matching an exact text is straightforward - just use the whole text instead
of the single word example I gave before. If the text is the same apart from capitalisation you can use the appropriate \* switches in your MERGEFIELD field to make the text upper or lower case. You can also use wildcards to a limited extent, e.g. { IF { MERGEFIELD myfield } = "*blank" "x" "y" } should give you "x" if myfield contains your sample text. You can also do { IF { MERGEFIELD myfield } = "something*" "x" "y" } but you can't achieve a "contains" using { IF { MERGEFIELD myfield } = "*something*" "x" "y" } It doesn't work. Also, you may find that matching only works on relatively short texts up to 128 characters. There's more about this in Word Help. Peter Jamieson wrote in message ups.com... The field contains a statement "This field intentionally left blank". I am merging many fields and this is just one of them. I don't want to skip the record, I just want to print nothing if this is in the field. Myrna |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
NO CODE - mail merge to Outlook with attachment with CC | Mailmerge | |||
Adding a field to an Off 97 mail merge using Office Pro 2003 | Mailmerge | |||
Mail Merge Losing Data | Mailmerge | |||
Mail Merge - Parameter prompts twice... | Mailmerge | |||
mail merge with attachments | Mailmerge |