View Single Post
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default "too many data fields " error

Hi st,

I'm running out of steam a bit here, so can probaby only reply properly
2morrow, but can you bie a bit more specific about the format and content of
the data source? What do you mean by the "First page" etc.? I had the
impression from your earlier message that you were using a delimited text
file as the data source, but now it sounds more like a Word document or
Excel file.

"Automerge" fields generally indicate that Word could not find a heading for
a column that contains data, e.g. if you have an Excel sheet with colum
heading in row 1 for columns 1 to 9, but data in column 10 with no heading
in that column, you might get an Automerge field - if you're using an Excel
file, make sure there is a heading for each column that has not been
"cleared" in the excel sheet.

best I can do for now,

Peter Jamieson

"zSplash" zNOSPAMSplash@ gci.net wrote in message
...
Thanks, Peter for the help and suggestions.

Well, the only thing that looks unusual from running your sub is an
AutoMerge field, which I can't find in the doc.
Anyway, since the first page works great, I just cut everything but the
first page out of the dataSource, and then copied the first page a second
time. Should have generated 2 documents. Got the same error message, and
only one document generated.

Any other hope?

st.

"Peter Jamieson" wrote in message
...
...
However, that doesn't really help, so:
a. how many columns do you expect Word to find in the data source? Is it
60, 277, or something else?
b. If you execute the following VBA code and look at the results in the

VBE
Immediate window, does that give you any clues about what is happening?

Sub showds()
Dim objDataField As MailMergeDataField
For Each objDataField In ActiveDocument.MailMerge.DataSource.DataFields
Debug.Print objDataField.Name, objDataField.Value
Next
End Sub

Peter Jamieson
"zSplash" zNOSPAMSplash@ gci.net wrote in message
...
When I run my mail merge for a single record, I get no errors. When I

run
the mail merge with more than one record, I get a "Record contained too
many
data fields" error.

Others' help with this question suggested "usually caused by a mismatch
between the number of fields listed in the header record of the data
source
and the number of fields Word finds in the data records." I have tried

to
compare these two, but evidently they're REALLY different, unless I'm
misinterprinting the following:
MsgBox ActiveDocument.MailMerge.Fields.Count = 60
MsgBox ActiveDocument.MailMerge.DataSource.DataFields.Cou nt =
277

My delimiter is "|", and I don't believe it's anywhere it shouldn't be.
As
I've said, individual records work great, but multiple records give me
this
error, and generate only one document.

Any suggestions as to how to solve this problem?

TIA