View Single Post
  #2  
Old April 29th, 2010, 08:05 PM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
Default How do I create a data source within an excel document?

What Word expects in a data source is that it is a rectangular table.
The first row contains the field names (or column names). Subsequent
rows contain the data. e.g. a very simple example:

City Country
London England
New York USA
Berlin Germany

It would be very easy to set that up in Excel. IN Sheet1, you would put
the text "City" (without the quotes) in cell A1, "Country" in B1,
London in A2, England in B2, New York in A3, USA in B3, and so on.

With Excel data sources it's advisable to
a. have your data in the first sheet in the workbook
b. have the same kind of data in every cell in a column - e.g. if you
have a column that mostly has numbers in it, don't try to put a piece of
text in one of the cells.
c. avoid putting Excel formulas in the cells (OK, that rather reduces
the value of Excel, but it can cause problems during merges)
d. ensure that if you have long texts in a column (over 255
characters), that at least one cell in the first 8 cells in that column
has a long text.
e. avoid more than 255 columns - even though Excel 2007 can have more,
none of the mechanisms that Word uses to get data from Excel can see
beyond 255/256 columns.
f. realise that any cell formatting you apply will probably need to be
re-applied in the form of Word field "format switches" because the
default method that Word uses to retrieve Excel data in Word 2002 and
later (OLE DB) tends to discard cell formatting. So if for example you
have amounts in different currencies in the same column in Excel, make
sure you record the currency symbol in a separate column, or it will
probably be lost. If you want to record US Zip codes, phone numbers,
etc., it will almost certainly be worth spending some time looking
through the articles in this group (and I expect Graham may be along
with some good pointers).

Some of the above may not mean a lot right now, but it probably will,
soon enough.

I know Excel is a very popular data source for merges because many
people use Excel as their primary program for maintaining simple tables
of data, but the way Word gets data from Excel can cause problems, and
those problems can seem arbitrary because a lot of decisions are made
depending on what is in the first 8 (data) cells in each column, i.e.
the results you see can vary

Peter Jamieson

http://tips.pjmsn.me.uk

On 29/04/2010 19:34, Tracy wrote:
I am trying to do a mail merge with Word and Excel. It tells me to select a
data source, but not how to create one in Excel.