View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Word cannot find data source problem

Well spotted on the incorrect display of the file path name, but
unfortunately as far as I know it is a red herring and does not indicate
anything other than a fault in the display. Further, whether the Mailmerge
task pane displays the "long" data source location details or just the short
file name depends on whether the data source is in what Word thinks is the
"active" folder" (I think) - i.e. it is likely to change to that folder if
you create a test .csv in Word and save it.

However, things are complicated by the fact that Word has a number of
different mechanisms for opening a .tx or .csv type file and chooses the
mechanism depending on the file content (I think). I don't work for
Microsoft or have have access to the source code, so I have to guess, but in
Word 2002(XP) and 2003, I believe Word will either use Word's built-in text
converter to read the file, or OLE DB. If it uses OLE DB, it generates a
"connection string" which contains the path name of the folder containing
the file. However, Word does not save the whole connection string (max 255
characters I think) and can truncate the pathname, so when you close and
re-open the When you close the mail merge main document and re-open it, Word
can't find the file.I'm not so sure that happens when Word opens the file
using its converter.

Anyway, if you try putting the file in a folder with a short pathname I
think it will always work.

However, there could also be problems if Word does not recognise the
character encoding of your .csv file correctly - but let's leave that for
now.

Peter Jamieson

wrote in message
ps.com...
Hi,

I'm having a problem getting Word to remember the link to its data
source for some files. It continually asks to locate the data source
and if you point it to the file it just continually loops back and
asks for the file location again. If you tell it "No" on the SQL
check dialog, the file opens and I can go to "Open Data Source" and
point to the file that way.

The merge document is a one page letter. The data is a simple csv
file with only 10 fields.

I've tried putting the csv file in the My Data Sources folder and that
doesn't fix it.

I've tried using the registry setting to skip the SQL check, but that
means I end up in the "Locate Data Source" loop with no way of opening
the file at all.

The closest thing I've come up with that sort of gets me to a work
around is that some of the field headings have an underscore in them:
First_Name, Last_Name, Address_1, etc. However, if I make a new csv
file in notepad and make the names with an _, it works fine. But then
I get the second clue.

If I click on Tools | Letters and Mailings | Mail Merge to get the
Mail Merge side bar, step 3 has some weirdness. On the csv file that
does not work, the source that the recipients are currently selected
from appears as:

[:\foldername\source.cs] in "source.csv"

If I make a csv file from scratch and do not use any underscores, that
line becomes just:

"test.csv"

But as soon as I change a field name in the working csv file to
contain and underscore it changes to:

[:\foldername\test.cs] in "test.csv"

It still works, probably because somewhere in the file it remembers
that it used to work before I changed the file name, but who knows at
this point.

Has anyone else run into something similar or know of a fix?

Thanks!