MailMerge Data Sources

B

Bill S.

Hi,

I'm sure if this is the right newsgroup, but I'm hoping I can get some info
about MSWord MailMerge data sources. I'm driving Word through the COM
interface in my VB.NET program, and I've create a table in my DataSet. I'm
trying to use this table as a data source for a MailMerge. Is this possible?
I can't seem to get the OpenDataSource() sub to work.

What data sources are possible?
Are there any Web sites with example VBA/VB.NET/VB6 code?

Any help would be greatly appreciated.
 
P

Peter Jamieson

Word can use a number of different types of data source, but they are all
either "file data sources", e.g. a .csv file, excel file, access .mdb, or
oledb/odbc data sources.

To use a "disconnected recordset" of any kind, you would have either to be
able to access it via an existing OLEDB provider/ODBC driver (I know of no
way to do this) or write your own OLEDB provider/ODBC driver (or, just
possibly, text converter) to do the job, and I'm not sure even that is
feasible unless you are able to pass a usable reference to the recordset you
want to use.

If you commit your dataset to (say) a SQLServer database, you should be able
to use an OLEDB or ODBC connection in OpenDataSource, but for OLEDB you will
need an external .odc file and for ODBC you will need an external DSN
(either "machine", or "file"). For OLEDB you may be able to create an empty
..odc file and provide all the necessary connection info. in the Connection
parameter of the OpenDataSource method.

Peter Jamieson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top