Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Chaplain Doug Chaplain Doug is offline
external usenet poster
 
Posts: 7
Default Problem Connecting to a CSV File in Word 2007

Windows Vista Ultimate. Office 2007 Professional. Word 2007.

In Word 2003 I can connect my document to a .CSV file as my data source and
it remembers and maintains the data connection when I save the file and open
it later. However, in Word 2007 when I connect to a .CSV file as the data
source and save the file, the next time I open the file it is no longer
connected to the .CSV file. I have to go through all the steps to connect to
a data source again. If I use a regular Excel file (.xls) I do not have this
problem. I need to be able to have this work for a .CSV file.

Why is this simple function not working in Word 2007? Is it a known bug?
How Can I fix this issue???

Thanks for the help.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Problem Connecting to a CSV File in Word 2007

I am unable to replicate that problem when using Word 2007 on Vista
Business. I believe that it is unlikely that Vista Ultimate would make a
difference.

Are you getting the message

Opening this document will run the following SQL command:
SELECT * FROM [Drive:\Path\FileName].csv
Data from your database will be placed in the document. Do you want to
continue?

Where is the datasource located? Is it on a network with a long path
filename?

--
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

"Chaplain Doug" wrote in message
...
Windows Vista Ultimate. Office 2007 Professional. Word 2007.

In Word 2003 I can connect my document to a .CSV file as my data source
and
it remembers and maintains the data connection when I save the file and
open
it later. However, in Word 2007 when I connect to a .CSV file as the data
source and save the file, the next time I open the file it is no longer
connected to the .CSV file. I have to go through all the steps to connect
to
a data source again. If I use a regular Excel file (.xls) I do not have
this
problem. I need to be able to have this work for a .CSV file.

Why is this simple function not working in Word 2007? Is it a known bug?
How Can I fix this issue???

Thanks for the help.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Chaplain Doug Chaplain Doug is offline
external usenet poster
 
Posts: 7
Default Problem Connecting to a CSV File in Word 2007

Thank for responding Doug. I do not get the dialog:

Opening this document will run the following SQL command:
SELECT * FROM [Drive:\Path\FileName].csv

I expect this to come up, but is does not. Even after I have manually made
the connection to the CSV file (and seen the data come up in the Word
document when I merge), it does not seem to save the connection. For when I
save the Word file (which has been successfully connected to the CSV data
source), I do not get the above message when I reopen the file, nor is the
CSV data file connected to the Word document.

The CSV file resides in a subfolder of My Documents. Hence it is not a long
network path. Any other ideas?

--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org


"Doug Robbins - Word MVP" wrote:

I am unable to replicate that problem when using Word 2007 on Vista
Business. I believe that it is unlikely that Vista Ultimate would make a
difference.

Are you getting the message

Opening this document will run the following SQL command:
SELECT * FROM [Drive:\Path\FileName].csv
Data from your database will be placed in the document. Do you want to
continue?

Where is the datasource located? Is it on a network with a long path
filename?

--
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

"Chaplain Doug" wrote in message
...
Windows Vista Ultimate. Office 2007 Professional. Word 2007.

In Word 2003 I can connect my document to a .CSV file as my data source
and
it remembers and maintains the data connection when I save the file and
open
it later. However, in Word 2007 when I connect to a .CSV file as the data
source and save the file, the next time I open the file it is no longer
connected to the .CSV file. I have to go through all the steps to connect
to
a data source again. If I use a regular Excel file (.xls) I do not have
this
problem. I need to be able to have this work for a .CSV file.

Why is this simple function not working in Word 2007? Is it a known bug?
How Can I fix this issue???

Thanks for the help.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org




  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Chaplain Doug Chaplain Doug is offline
external usenet poster
 
Posts: 7
Default Problem Connecting to a CSV File in Word 2007

Actually Doug the dialog:

Opening this document will run the following SQL command:
SELECT * FROM [Drive:\Path\FileName].csv

does appear, but when I click "OK" it them tells me it cannot find the file.
If I browse out to the CSV file and select it, it gives an error and will
not connect. I tried this on another system that is running Word 2007 with
Windows XP. I got the same problem. Hence it is reproducible and appears to
be inhernet with Word 2007. What now???

--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org


"Doug Robbins - Word MVP" wrote:

I am unable to replicate that problem when using Word 2007 on Vista
Business. I believe that it is unlikely that Vista Ultimate would make a
difference.

Are you getting the message

Opening this document will run the following SQL command:
SELECT * FROM [Drive:\Path\FileName].csv
Data from your database will be placed in the document. Do you want to
continue?

Where is the datasource located? Is it on a network with a long path
filename?

--
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

"Chaplain Doug" wrote in message
...
Windows Vista Ultimate. Office 2007 Professional. Word 2007.

In Word 2003 I can connect my document to a .CSV file as my data source
and
it remembers and maintains the data connection when I save the file and
open
it later. However, in Word 2007 when I connect to a .CSV file as the data
source and save the file, the next time I open the file it is no longer
connected to the .CSV file. I have to go through all the steps to connect
to
a data source again. If I use a regular Excel file (.xls) I do not have
this
problem. I need to be able to have this work for a .CSV file.

Why is this simple function not working in Word 2007? Is it a known bug?
How Can I fix this issue???

Thanks for the help.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org




  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Problem Connecting to a CSV File in Word 2007

Where is the datasource located? Is it on a network with a long path
filename?


--
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

"Chaplain Doug" wrote in message
...
Actually Doug the dialog:

Opening this document will run the following SQL command:
SELECT * FROM [Drive:\Path\FileName].csv

does appear, but when I click "OK" it them tells me it cannot find the
file.
If I browse out to the CSV file and select it, it gives an error and will
not connect. I tried this on another system that is running Word 2007
with
Windows XP. I got the same problem. Hence it is reproducible and appears
to
be inhernet with Word 2007. What now???

--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org


"Doug Robbins - Word MVP" wrote:

I am unable to replicate that problem when using Word 2007 on Vista
Business. I believe that it is unlikely that Vista Ultimate would make
a
difference.

Are you getting the message

Opening this document will run the following SQL command:
SELECT * FROM [Drive:\Path\FileName].csv
Data from your database will be placed in the document. Do you want to
continue?

Where is the datasource located? Is it on a network with a long path
filename?

--
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

"Chaplain Doug" wrote in message
...
Windows Vista Ultimate. Office 2007 Professional. Word 2007.

In Word 2003 I can connect my document to a .CSV file as my data source
and
it remembers and maintains the data connection when I save the file and
open
it later. However, in Word 2007 when I connect to a .CSV file as the
data
source and save the file, the next time I open the file it is no longer
connected to the .CSV file. I have to go through all the steps to
connect
to
a data source again. If I use a regular Excel file (.xls) I do not
have
this
problem. I need to be able to have this work for a .CSV file.

Why is this simple function not working in Word 2007? Is it a known
bug?
How Can I fix this issue???

Thanks for the help.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org








  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Chaplain Doug Chaplain Doug is offline
external usenet poster
 
Posts: 7
Default Problem Connecting to a CSV File in Word 2007

No long path name. The file resides in:

C:\Documents and Settings\All Users\Documents\Thank You Letters\File.csv

and similar locations on other systems tested.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org


"Doug Robbins - Word MVP" wrote:

Where is the datasource located? Is it on a network with a long path
filename?


--
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

"Chaplain Doug" wrote in message
...
Actually Doug the dialog:

Opening this document will run the following SQL command:
SELECT * FROM [Drive:\Path\FileName].csv

does appear, but when I click "OK" it them tells me it cannot find the
file.
If I browse out to the CSV file and select it, it gives an error and will
not connect. I tried this on another system that is running Word 2007
with
Windows XP. I got the same problem. Hence it is reproducible and appears
to
be inhernet with Word 2007. What now???

--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org


"Doug Robbins - Word MVP" wrote:

I am unable to replicate that problem when using Word 2007 on Vista
Business. I believe that it is unlikely that Vista Ultimate would make
a
difference.

Are you getting the message

Opening this document will run the following SQL command:
SELECT * FROM [Drive:\Path\FileName].csv
Data from your database will be placed in the document. Do you want to
continue?

Where is the datasource located? Is it on a network with a long path
filename?

--
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

"Chaplain Doug" wrote in message
...
Windows Vista Ultimate. Office 2007 Professional. Word 2007.

In Word 2003 I can connect my document to a .CSV file as my data source
and
it remembers and maintains the data connection when I save the file and
open
it later. However, in Word 2007 when I connect to a .CSV file as the
data
source and save the file, the next time I open the file it is no longer
connected to the .CSV file. I have to go through all the steps to
connect
to
a data source again. If I use a regular Excel file (.xls) I do not
have
this
problem. I need to be able to have this work for a .CSV file.

Why is this simple function not working in Word 2007? Is it a known
bug?
How Can I fix this issue???

Thanks for the help.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org






  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Problem Connecting to a CSV File in Word 2007

That does not look like a Vista file path to me.

On my Vista machine, the default file path for the data source is:

C:\Users\Doug\Documents\My Data Sources

The equivalent on a machine running Windows XP would be:

C:\Documents and Settings\Doug Robbins\My Documents\My Data Sources

--
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

"Chaplain Doug" wrote in message
...
No long path name. The file resides in:

C:\Documents and Settings\All Users\Documents\Thank You Letters\File.csv

and similar locations on other systems tested.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org


"Doug Robbins - Word MVP" wrote:

Where is the datasource located? Is it on a network with a long path
filename?


--
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

"Chaplain Doug" wrote in message
...
Actually Doug the dialog:

Opening this document will run the following SQL command:
SELECT * FROM [Drive:\Path\FileName].csv

does appear, but when I click "OK" it them tells me it cannot find the
file.
If I browse out to the CSV file and select it, it gives an error and
will
not connect. I tried this on another system that is running Word 2007
with
Windows XP. I got the same problem. Hence it is reproducible and
appears
to
be inhernet with Word 2007. What now???

--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org


"Doug Robbins - Word MVP" wrote:

I am unable to replicate that problem when using Word 2007 on Vista
Business. I believe that it is unlikely that Vista Ultimate would
make
a
difference.

Are you getting the message

Opening this document will run the following SQL command:
SELECT * FROM [Drive:\Path\FileName].csv
Data from your database will be placed in the document. Do you want
to
continue?

Where is the datasource located? Is it on a network with a long path
filename?

--
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

"Chaplain Doug" wrote in
message
...
Windows Vista Ultimate. Office 2007 Professional. Word 2007.

In Word 2003 I can connect my document to a .CSV file as my data
source
and
it remembers and maintains the data connection when I save the file
and
open
it later. However, in Word 2007 when I connect to a .CSV file as
the
data
source and save the file, the next time I open the file it is no
longer
connected to the .CSV file. I have to go through all the steps to
connect
to
a data source again. If I use a regular Excel file (.xls) I do not
have
this
problem. I need to be able to have this work for a .CSV file.

Why is this simple function not working in Word 2007? Is it a known
bug?
How Can I fix this issue???

Thanks for the help.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org








  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Problem Connecting to a CSV File in Word 2007

Fellow MVP, Peter Jamieson, posted this to another forum. I am not sure if
any of it is applicable to your situation, but as Peter says at the end of
the post - "Worth a try."

Quote

What happens is that when you connect via OLE DB in the first instance, and
save the document, the OLE DB connect string is set up correctly and saved.

If you re-open the document when that data source is no longer there (e.g.
has been moved) you should see:
a. the SQL Warning
b. the OLE DB dtaalink dialog box, which will probably display the existing
path.

So you change the path, and the document works OK. You are now at point (A).
So you save the mail merge main document to save the modified path.

Unfortunately, for reasons I can only guess at, when you get to point (A),
the Mailmerge data structures still reference the /old/ path. You may be
able to see this if you try that

print ActiveDocument.MailMerge.DataSource.ConnectString

statement in VBA's immediate window again. Also

print ActiveDocument.MailMerge.DataSource.Name
and
print ActiveDocument.MailMerge.DataSource.Tablename

have SQL that just references the worksheet, not the workbook pathname.

So when you save the document, the new pathname is not saved.

My guess is that this is because when Word connects via OLE DB, it uses a
thing called the Office Data Source Object (ODSO) and that in this
situation, the prompts are handled entirely by ODSO and are never "handed
back" to Word (for wahatever reason. Because Word VBA has no mechanism to
get a reference to the ODSO object, it's not possible to discover what's
going on inside it. (Well, OK, I guess someone who knows how to get the ODSO
object's address some other way could do it).

So I think what you probably need to do is...
a. open the document, and jump through the usual hoops to connect to your
data source (doesn't matter how).
b. detach the data source altogether - e.g. select "Normal Word Document"
using the first button on the MailMerge toolbar
c. select the Mailmerge document type you want again
d. re-attach the data source in the usual way
e. save the mail merge main document
f. close & re-open - you should "just" get the SQL Warning dialog.

The main snag with this sequence is that for certain types of mail merge
main document, step (c) will trigger additional dialogs that you could
probably do without, e.g. if it's Labels or Envelopes merge. The only way I
can see to avoid this is to use VBA, e.g.

Sub reconnect()
With ActiveDocument.MailMerge
' as far as I know, .Close is new in Word 2003. It seems to have the
desired effect of removing the existing data source
' without changing the type of mail merge main document, whereas the only
way to disconnect UI (new or old) is to change
' the Mail megre main document type to "Normal Word Document".
.DataSource.Close
' open the source you want
.OpenDataSource "C:\Documents and Settings\Suzanne\My Documents\Excel
Files\Rotary\Attendance.xls "
End With

End Sub

Then you need to save the mail merge main document.

Worth a try, anyway...

Unquote
--
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

"Chaplain Doug" wrote in message
...
No long path name. The file resides in:

C:\Documents and Settings\All Users\Documents\Thank You Letters\File.csv

and similar locations on other systems tested.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org


"Doug Robbins - Word MVP" wrote:

Where is the datasource located? Is it on a network with a long path
filename?


--
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

"Chaplain Doug" wrote in message
...
Actually Doug the dialog:

Opening this document will run the following SQL command:
SELECT * FROM [Drive:\Path\FileName].csv

does appear, but when I click "OK" it them tells me it cannot find the
file.
If I browse out to the CSV file and select it, it gives an error and
will
not connect. I tried this on another system that is running Word 2007
with
Windows XP. I got the same problem. Hence it is reproducible and
appears
to
be inhernet with Word 2007. What now???

--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org


"Doug Robbins - Word MVP" wrote:

I am unable to replicate that problem when using Word 2007 on Vista
Business. I believe that it is unlikely that Vista Ultimate would
make
a
difference.

Are you getting the message

Opening this document will run the following SQL command:
SELECT * FROM [Drive:\Path\FileName].csv
Data from your database will be placed in the document. Do you want
to
continue?

Where is the datasource located? Is it on a network with a long path
filename?

--
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

"Chaplain Doug" wrote in
message
...
Windows Vista Ultimate. Office 2007 Professional. Word 2007.

In Word 2003 I can connect my document to a .CSV file as my data
source
and
it remembers and maintains the data connection when I save the file
and
open
it later. However, in Word 2007 when I connect to a .CSV file as
the
data
source and save the file, the next time I open the file it is no
longer
connected to the .CSV file. I have to go through all the steps to
connect
to
a data source again. If I use a regular Excel file (.xls) I do not
have
this
problem. I need to be able to have this work for a .CSV file.

Why is this simple function not working in Word 2007? Is it a known
bug?
How Can I fix this issue???

Thanks for the help.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org








Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
word 2007 experienced a problem opening a .docx file it saved LL Microsoft Word Help 7 February 24th 08 12:07 PM
Vista Explorer cannot find Word 2007 file - important problem David Microsoft Word Help 1 October 8th 07 04:24 AM
Problem connecting database to word template for mailmerge garycoon7 Mailmerge 3 July 27th 07 10:40 AM
Word 2007 File Size Problem JohnnyG Microsoft Word Help 2 February 28th 07 08:23 PM
Word 2007 save as html - file locked problem Picho Microsoft Word Help 1 January 19th 07 10:52 AM


All times are GMT +1. The time now is 02:15 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"