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  

Word 2007 Mail Merge puts in a space for empty fields from Excel 2



 
 
Thread Tools Display Modes
  #1  
Old January 13th, 2009, 12:03 AM posted to microsoft.public.word.mailmerge.fields
SlowHnds
external usenet poster
 
Posts: 3
Default Word 2007 Mail Merge puts in a space for empty fields from Excel 2

Mail merge in Word 2007 data file is Excel spreadsheet 2007. When I merge the
document (Word 2007) with the data file (Excel 2007) and there is empty
fields in the data file, Word inserts a space. I don't want it to enter
anything.

field names in excel

Salute FirstName MidInital LastName Mail1 Mail2 location Prov Postcode

When I merge this to a document that is

Dear Salute FirstName MidInital LastName

Thank you for your ......


If the excel spread sheet contains a blank (null) field, when the word
document is merged it inserts a space. How do I stop this where the field is
empty don't put in anything, no space, just skip to the next field.

So I could get

Dear Simpson

Thank you for ......

......

Instead I get

Dear ___ (3 spaces) Simpson,


  #2  
Old January 13th, 2009, 12:59 AM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
Default Word 2007 Mail Merge puts in a space for empty fields from Excel2

Dear{ MERGEFIELD Salute \b" " }{ MERGEFIELD FirstName \b" " }{
MERGEFIELD MidInitial \b" " }{ MERGEFIELD LastName \b" " }

Where all the {} are the special field code braces you can insert using
ctrl-F9 and toggle using Alt-F9.

This only works on recent versions of Windows Word

Peter Jamieson

http://tips.pjmsn.me.uk

SlowHnds wrote:
Mail merge in Word 2007 data file is Excel spreadsheet 2007. When I merge the
document (Word 2007) with the data file (Excel 2007) and there is empty
fields in the data file, Word inserts a space. I don't want it to enter
anything.

field names in excel

Salute FirstName MidInital LastName Mail1 Mail2 location Prov Postcode

When I merge this to a document that is

Dear Salute FirstName MidInital LastName

Thank you for your ......


If the excel spread sheet contains a blank (null) field, when the word
document is merged it inserts a space. How do I stop this where the field is
empty don't put in anything, no space, just skip to the next field.

So I could get

Dear Simpson

Thank you for ......

.....

Instead I get

Dear ___ (3 spaces) Simpson,


  #3  
Old January 13th, 2009, 08:10 PM posted to microsoft.public.word.mailmerge.fields
SlowHnds
external usenet poster
 
Posts: 3
Default Word 2007 Mail Merge puts in a space for empty fields from Exc

This keeps the spaces when I tested it in MS Word 2007.

I want MS Word not to do anything if the merge field in Excel is empty/null.
NO space added.

Dwade

"Peter Jamieson" wrote:

Dear{ MERGEFIELD Salute \b" " }{ MERGEFIELD FirstName \b" " }{
MERGEFIELD MidInitial \b" " }{ MERGEFIELD LastName \b" " }

Where all the {} are the special field code braces you can insert using
ctrl-F9 and toggle using Alt-F9.

This only works on recent versions of Windows Word

Peter Jamieson

http://tips.pjmsn.me.uk

SlowHnds wrote:
Mail merge in Word 2007 data file is Excel spreadsheet 2007. When I merge the
document (Word 2007) with the data file (Excel 2007) and there is empty
fields in the data file, Word inserts a space. I don't want it to enter
anything.

field names in excel

Salute FirstName MidInital LastName Mail1 Mail2 location Prov Postcode

When I merge this to a document that is

Dear Salute FirstName MidInital LastName

Thank you for your ......


If the excel spread sheet contains a blank (null) field, when the word
document is merged it inserts a space. How do I stop this where the field is
empty don't put in anything, no space, just skip to the next field.

So I could get

Dear Simpson

Thank you for ......

.....

Instead I get

Dear ___ (3 spaces) Simpson,



  #4  
Old January 13th, 2009, 08:41 PM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
Default Word 2007 Mail Merge puts in a space for empty fields from Exc

Did you ensure that there are no spaces between the fields?

i.e.

Dear{ MERGEFIELD Salute \b" " }{ MERGEFIELD FirstName \b" " }{
MERGEFIELD MidInitial \b" " }{ MERGEFIELD LastName \b" " }

not

Dear { MERGEFIELD Salute \b" " } { MERGEFIELD FirstName \b" " } {
MERGEFIELD MidInitial \b" " } { MERGEFIELD LastName \b" " }

Another aproach is to use IF fields:

Dear{ IF "{ MERGEFIELD Salute }" = "" "" " { MERGEFIELD Salute }" }

and so on

Peter Jamieson

http://tips.pjmsn.me.uk

SlowHnds wrote:
This keeps the spaces when I tested it in MS Word 2007.

I want MS Word not to do anything if the merge field in Excel is empty/null.
NO space added.

Dwade

"Peter Jamieson" wrote:

Dear{ MERGEFIELD Salute \b" " }{ MERGEFIELD FirstName \b" " }{
MERGEFIELD MidInitial \b" " }{ MERGEFIELD LastName \b" " }

Where all the {} are the special field code braces you can insert using
ctrl-F9 and toggle using Alt-F9.

This only works on recent versions of Windows Word

Peter Jamieson

http://tips.pjmsn.me.uk

SlowHnds wrote:
Mail merge in Word 2007 data file is Excel spreadsheet 2007. When I merge the
document (Word 2007) with the data file (Excel 2007) and there is empty
fields in the data file, Word inserts a space. I don't want it to enter
anything.

field names in excel

Salute FirstName MidInital LastName Mail1 Mail2 location Prov Postcode

When I merge this to a document that is

Dear Salute FirstName MidInital LastName

Thank you for your ......


If the excel spread sheet contains a blank (null) field, when the word
document is merged it inserts a space. How do I stop this where the field is
empty don't put in anything, no space, just skip to the next field.

So I could get

Dear Simpson

Thank you for ......

.....

Instead I get

Dear ___ (3 spaces) Simpson,


  #5  
Old January 13th, 2009, 11:07 PM posted to microsoft.public.word.mailmerge.fields
SlowHnds
external usenet poster
 
Posts: 3
Default Word 2007 Mail Merge puts in a space for empty fields from Exc

Ok, I got it now and I understand how the \b switch works in this instance,
only adds a space between populated fields, not null.

Thanks for the post. I now have 850 letters correctly spaced.


"Peter Jamieson" wrote:

Did you ensure that there are no spaces between the fields?

i.e.

Dear{ MERGEFIELD Salute \b" " }{ MERGEFIELD FirstName \b" " }{
MERGEFIELD MidInitial \b" " }{ MERGEFIELD LastName \b" " }

not

Dear { MERGEFIELD Salute \b" " } { MERGEFIELD FirstName \b" " } {
MERGEFIELD MidInitial \b" " } { MERGEFIELD LastName \b" " }

Another aproach is to use IF fields:

Dear{ IF "{ MERGEFIELD Salute }" = "" "" " { MERGEFIELD Salute }" }

and so on

Peter Jamieson

http://tips.pjmsn.me.uk

SlowHnds wrote:
This keeps the spaces when I tested it in MS Word 2007.

I want MS Word not to do anything if the merge field in Excel is empty/null.
NO space added.

Dwade

"Peter Jamieson" wrote:

Dear{ MERGEFIELD Salute \b" " }{ MERGEFIELD FirstName \b" " }{
MERGEFIELD MidInitial \b" " }{ MERGEFIELD LastName \b" " }

Where all the {} are the special field code braces you can insert using
ctrl-F9 and toggle using Alt-F9.

This only works on recent versions of Windows Word

Peter Jamieson

http://tips.pjmsn.me.uk

SlowHnds wrote:
Mail merge in Word 2007 data file is Excel spreadsheet 2007. When I merge the
document (Word 2007) with the data file (Excel 2007) and there is empty
fields in the data file, Word inserts a space. I don't want it to enter
anything.

field names in excel

Salute FirstName MidInital LastName Mail1 Mail2 location Prov Postcode

When I merge this to a document that is

Dear Salute FirstName MidInital LastName

Thank you for your ......


If the excel spread sheet contains a blank (null) field, when the word
document is merged it inserts a space. How do I stop this where the field is
empty don't put in anything, no space, just skip to the next field.

So I could get

Dear Simpson

Thank you for ......

.....

Instead I get

Dear ___ (3 spaces) Simpson,



 




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


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