A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Eliminating a value in a mail merge



 
 
Thread Tools Display Modes
  #1  
Old March 28th, 2006, 06:06 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Eliminating a value in a mail merge

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  
Old March 28th, 2006, 06:19 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Eliminating a value in a mail merge

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  
Old March 28th, 2006, 07:15 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Eliminating a value in a mail merge

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  
Old March 28th, 2006, 07:26 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Eliminating a value in a mail merge

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  
Old March 28th, 2006, 07:35 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Eliminating a value in a mail merge

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  
Old March 28th, 2006, 07:36 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Eliminating a value in a mail merge

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  
Old March 28th, 2006, 07:40 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Eliminating a value in a mail merge

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  
Old March 28th, 2006, 07:55 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Eliminating a value in a mail merge

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  
Old March 28th, 2006, 07:59 PM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Eliminating a value in a mail merge

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  
Old March 29th, 2006, 06:43 AM posted to microsoft.public.word.mailmerge.fields
external usenet poster
 
Posts: n/a
Default Eliminating a value in a mail merge

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?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NO CODE - mail merge to Outlook with attachment with CC GillianHG Mailmerge 3 February 10th, 2010 02:53 PM
How do I mail merge to EMAIL from MS Word AND add a pdf attachment Lily@Insight Mailmerge 24 January 15th, 2007 09:33 PM
Difficult for me, probably basic to you onlyjohn Worksheet Functions 1 February 3rd, 2006 05:14 PM
How to stop source prompt in mail merge from access mvb Mailmerge 0 September 6th, 2005 05:11 PM
Mail Merge for Catalog document Terry General Discussion 1 July 27th, 2004 05:33 AM


All times are GMT +1. The time now is 10:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.