Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / August 2004

Tip: Looking for answers? Try searching our database.

run-time error '5922' and csv files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dominic Godin - 26 Aug 2004 12:11 GMT
Hi,

I have a macro in a word template that falls over with this code.

'Set object reference to this mail merge (convenience coding)
Set thisMerge = ThisDocument.MailMerge
   
'Setup the mail merge datasource
With thisMerge
       'Set the merge type
      .MainDocumentType = wdFormLetters
      'Set the data source information. Falls over here!!
      .OpenDataSource name:= "C:\Temp\batchmerge.csv"    
      .SuppressBlankLines = True
      .execute
End With

The file batchmerge does exist and isn't corrupt.  This works for most
of our clients.  The client it falls over on is using metaframe and word
2000.  I get the error can not open data source.  Is this due to ODBC
settings or something.  I know little about metaframe but our engineer
says that the user can see C:\Temp\batchmerge.csv.

Any ideas??

Dominic Godin
Cindy M  -WordMVP- - 27 Aug 2004 11:10 GMT
Hi Dominic,

When picking up a text file in Word 2000 (note _2000_, not 2002 or 2003 -
this is important!), Word has the choice of using ODBC or its internal text
converter. Given your macro code, I'd assume Word will try to use the text
converter (you don't specify a DSN or anything of that sort). That should
be present on every machine and not cause a problem. OTOH, I don't know
anything about metaframe, either, so I don't know how/whether it might be
interfering.

The first thing I'd test, is whether this file can be opened in the UI. If
it can, then someone should record a macro while doing so, so that you can
compare the OpenDataSource code and see what kind of connection Word
"wants" to use.

My personal feeling is that this metaframe may somehow be blocking Word's
access to the external file.

> 'Set object reference to this mail merge (convenience coding)
> Set thisMerge = ThisDocument.MailMerge
[quoted text clipped - 14 lines]
> settings or something.  I know little about metaframe but our engineer
> says that the user can see C:\Temp\batchmerge.csv.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Dominic Godin - 27 Aug 2004 16:38 GMT
Thanks for the reply.

I managed to fix it in the end.  Apparently Word has some nasty bugs
with certain versions of the ODBC.  I switched the file extension from
csv to dat so word wouldn't use the ODBC and now all works fine.

Thanks

Dominic Godin

> Hi Dominic,
>
[quoted text clipped - 40 lines]
> This reply is posted in the Newsgroup; please post any follow question
> or reply in the newsgroup and not by e-mail :-)
Cindy M  -WordMVP- - 31 Aug 2004 17:43 GMT
Hi Dominic,

> I managed to fix it in the end.  Apparently Word has some nasty bugs
> with certain versions of the ODBC.  I switched the file extension from
> csv to dat so word wouldn't use the ODBC and now all works fine.

OK, thanks for letting me know. From your code, it didn't look like Word
was making an ODBC connection (no DSN mentioned), which is why I didn't
follow that track.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.