View Single Post
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Kevin Kevin is offline
external usenet poster
 
Posts: 85
Default Mail Merging: Omit Empty Fields?

Ahh i see with Ctrl + F9. Thank you very much for your time, I will try that
out!


"Peter Jamieson" wrote:

On the whole it is best to insert a nested field like

{ IF "{ MERGEFIELD email }" = ""
"" "
Email: { MERGEFIELD email }"
}

so you end up with e.g.

{ IF "{ MERGEFIELD "company name" }" = ""
"" "
Company Name: { MERGEFIELD "company name" }"
}{ IF "{ MERGEFIELD email }" = ""
"" "
Email: { MERGEFIELD email }"
}{ IF "{ MERGEFIELD phone }" = ""
"" "
Phone: { MERGEFIELD phone }"
}

(In recent versions of Windows Word you may be able to get away with

{ MERGEFIELD "company name" \b "Company Name: " }
{ MERGEFIELD email \b "Email: " }
{ MERGEFIELD phone \b "Phone: " }

but I would go for the nested IF approach).

All the {} need to be the special field code brace pairs that you can
insert using ctrl-F9, not the sort you can type on the keyboard.

Peter Jamieson

http://tips.pjmsn.me.uk

On 10/12/2009 18:28, Kevin wrote:
I am pulling info out of my database and inserting it into Microsoft Excel to
use as a mail merge for a listing of companies. The problem is that I do not
have all criteria for all companies, so for example if I didn't have an email
in my example below, "Email:" would appear with a blank next to it. Is there
any way to not show email if it is empty?

Company Name:company name
Email:email
Phone:phone




.