Mail merge maxing out?

J

Jeff Weinman

I have an excel file with 40 rows and 90 columns. Each of those columns is
different contact or personal information. I am trying to create a form
letter that will include all 90 of those columns so that it looks like

First
Last
Address
etc.

When the merge gets to about the 40th column, it quits working and looks like

birthdate fathers_name mothers_name etc

so not continuing to go down.

Any thoughts?

Also, it is possible to have the name of the merger field (so the column
header) be automatically inserted without having to put those in ahead of
time and then placing each merge field?

Thanks

Jeff
 
P

Peter Jamieson

I think I've seen something similar to this reported before, but haven't
been able to replicate it with a simple example here yet (Word/Excel 2003).

Which version of Word/Excel?

How is Word connecting to Excel, and does selecting another method make any
difference? (in Word 2002/2003, check Tools|Options|General|"Confirm
conversions at open", then reconnect).

If you are in a position to e-mail a sample data file that definitely does
not work, you can despam my e-mail address

(e-mail address removed)

email the file to me (and preferably a sample Word file) and I'll have a
look here.
Also, it is possible to have the name of the merger field (so the column
header) be automatically inserted without having to put those in ahead of
time and then placing each merge field?

There's no automated out-of-the-box fcility, but you could
a. use a bit of VBA code to grab the field names from the mergefields and
insert them, e.g. for the body of the document only, try:

Sub InsertColumnNames()

Dim objField As Field
Dim strFieldCode() As String
Dim strFieldName As String
For Each objField In ActiveDocument.Content.Fields
If objField.Type = wdFieldMergeField Then
strFieldCode = Split(objField.Code)
strFieldName = strFieldCode(2)
If Right(strFieldName, 1) = Chr(34) Then
strFieldName = Left(strFieldName, Len(strFieldName) - 1)
End If
If Left(strFieldName, 1) = Chr(34) Then
strFieldName = Right(strFieldName, Len(strFieldName) - 1)
End If
objField.Select
Selection.Range.InsertBefore strFieldName & ": "
End If
Next

End Sub

b. Word 2003 (and 2002 I think) has a "\b" switch for the MERGEFIELD field
switch that lets you insert text before the field if it contains data. If
you only want to see the row containing the field if it is not empty, you
can use

{ MERGEFIELD "myfield" \b "myfield: " }

You could adapt the above code to do that fairly quickly, I think.

Peter Jamieson
 
J

Jeff Weinman

Thanks Peter. I am using Word/Excel 2000 with XP SP2 (sorry I didn't include
that in the original question).

Thank you for the offer to look at the data. I will need to adjust some of
the info as I have some rather personal info (social security number,
passport numbers and the like). I will mock some up and send to you.

I did look through quite a number of previous posts, but didn't find
anything quite like this. Everything seemed to be about the max field size as
opposed to the max number of fields.

I am not sure what the 'connection method' means. I use the mail merge
function within word then find/open data source to connect to the excel file.
I actually imported the data into an access db to and tried merging that way
but got the same problem. With the 'Confirm conversions at open" do I sent up
the Word file then check for confirm, then close and reopen?

I have never done a VBA script, so that will be a fun exercise for me. Do I
do that code in word correct?

Thanks again. I will work on a 'public' data file for you.

Jeff
 
J

Jeff Weinman

Peter,

I must need cleaner glasses, but I can't figure out which part(s) of your
email address to remove. I tried a couple and got bounced.

I am at jeffweinman at yahoo dot com. Maybe you can send to me and then I
will have you?

Jeff
 
G

Graham Mayor

KillmapS

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
P

Peter Jamieson

Thanks Graham.

Peter J
Graham Mayor said:
KillmapS

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
P

Peter Jamieson

I've e-mailed you.

Peter Jamieson
Jeff Weinman said:
Peter,

I must need cleaner glasses, but I can't figure out which part(s) of your
email address to remove. I tried a couple and got bounced.

I am at jeffweinman at yahoo dot com. Maybe you can send to me and then I
will have you?

Jeff
 
G

Graham Mayor

Interesting spelling of Spam ;)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

Jeff Weinman

Odd, I didn't get a message at my yahoo account. But, thanks to Graham's
help, I have sent you a message.

Jeff
 
J

Jeff Weinman

Thank you Graham. Now that you point it out, it is quite obvious. I really do
need to clean my glasses I guess.

Jeff
 
J

Jeff Weinman

Peter got it for me!

I was using single and double quotes in heights 6'2" and that was causing my
problem. In retrospect, I can see from a programing standpoint that quotes
cause problems, but I didn't think of that in this instance.

Thanks for you help Peter.

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top