Word merge field names vs. Excel merge field names

V

viva.la.fisica

Hello everybody,
I realized that, when the Excel sheet contains headers named with
character strings containing spaces, dots, minus signs, apstrophes,
etc, these single characters, or sequences of these characters, are all
converted into a single underscore in Word fields.

For example, if my Excel sheet contains the following header names
(please ignore double quotes):

"name"
"last name"
"company.name"

then the Word document, after having joined it to the data source and
added to it the merge fields, will contain fields whose names are
respectively:

"name"
"last_name"
"company_name"

and this behaviour gives me some problems. Apart from the reason why I
have these problems, here is my question:

Is there a general rule which can be used to predict the exact form of
a certain Word merge field, given the exact form of the corresponding
header in the Excel sheet?

Thank you very much
Cardamomo
 
V

viva.la.fisica

Thank you Doug, but
the problem is that I have to repair to bad things done by our
customers. That is, I receive a MailMerge Word document and its data
source in Excel format. And you can't even imagine what our customers
can call the header fields in the Excel file!!! Something like "Company
Name", or "Citta' ", or even "Fax. number " (yes, with all
those trailing spaces!!!)
Thus, I really have to know the general rule for matching Word fields
and the corresponding Excel fields!

Thank you
Alessio
 
D

Doug Robbins - Word MVP

I think what I would do is delete the row containing the "field" names and
then replace it with a row containing appropriate field names.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
V

viva.la.fisica

Thank you again, Doug,
bvut the problem is that I have to manage the documents in ana
application, not me manually. That is, I have to instruct my
application (which now creates the single, merged documents, by merging
the record values of the Excel file into the merge fields of the Word
documents), I have to instruct my application in order to have it
AUTOMATICALLY "know" which Word merge field corresponds to which Excel
header.
Thus, I really cannot edit the files by hand (my work would change,
from computer programmer to Excel document editor, LOL).
I ahve to know the general rule that tells me "when you have an Excel
header field with spaces and dots, then its is replaced, in the
corresponding Word document merge field, with a string made of.....
etc".
I'm sure that Microsoft people know exactly this rule, because they
wrote the programs (i.e. Word and Excel) which do this mapping
automatically.

Thank you for your help (and any further help)
Alessio
 
D

Doug Robbins - Word MVP

It seems to me that a space is replace by an underscore, an underscore is
retained and other punctation type separators that I tried (' # & , etc) are
deleted.

I do not know of any source of rules on this and quite frankly, I am
surprised that field names that do not conform to the norms (from say the
dBase days) are not just rejected.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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