Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Kevin Kevin is offline
external usenet poster
 
Posts: 85
Default Mail Merging: Omit Empty Fields?

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




  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mail Merging: Omit Empty Fields?

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




  #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




.

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
In Mail Merge how do I get rid of empty fields? Ben K Mailmerge 1 December 9th 09 11:10 AM
Using if fields in mail merge to ignore empty fields Larry S. Mailmerge 9 August 15th 06 08:10 AM
omit blank mail merge fields gapkid Mailmerge 2 October 20th 05 07:19 AM
How do I omit an empty date merge field? Phildeman Microsoft Word Help 5 June 13th 05 03:29 PM
Word 2002 Mail Merge - merging to new doc displays blank empty dia Steve Vincent Mailmerge 1 December 15th 04 07:28 PM


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