View Single Post
  #2   Report Post  
Peter Jamieson
 
Posts: n/a
Default

What kind of Data Table? If you are talking about an ADO.NET data object,
the answer is that you cannot set a mail merge data source to be an object
inside a process - the data source has to be an external file of some kind,
e.g. a text file, table inside a .mdb, table inside a SQL database
accessible via OLEDB or ODBC, etc.

How are you actually coding the "refresh" ? If you are doing an
OpenDataSource in Word, you /may/ need to disconnect the data source first,
e.g.

ActiveDocument.MailMerge.DocumentType = wdNotAMergeDocument

However, if you do that, you will lose any sort/filter options that may have
been set, and you may also need to re-establish the Mail Merge Main Document
type.

Peter Jamieson


"goraya" wrote in message
oups.com...
Hi All
Is it possible to set Data Table as Mail Merge data source?????
A little detail why I am not using text file:
In my solution there a custom button that user can refresh data source
when he refreshes all the merge fields are collected from document and
saved to text file and set that file as data source.I close the file
stream and stream writer.So far as things are going fine........
But if he clicks the refresh data source button again an error is
prompted that Unable to access Text file because it is being used by
another process.why is it so as I close all the file related objects?
So I decide to go for data table for above mensioned reason and the
final word is
Is it possible to set Data Table as Mail Merge data source?????
With best regards
Qumer