?
Solved

Recordset to mailMerge???

Posted on 2003-03-07
1
Medium Priority
?
303 Views
Last Modified: 2012-06-27
Is it possible to us a recordset as a datasource to a word document within VB?  The recordset has some 50 records in which are correct, I have tried :
ActiveDocument.MailMerge.CreateDataSource , , , , , rst, dbConn

Along with other options is it possible to do and if so how?
0
Comment
Question by:amp81
1 Comment
 

Accepted Solution

by:
Broda earned 1500 total points
ID: 8089480
I've never used CreateDataSource but you can connect directly to the database file (if there is one) and run a query on it.

ActiveDocument.MailMerge.OpenDataSource _
  Name:="c:\db.mdb", _
  LinkToSource:=True, _
  Connection:="TABLE [" & tblName & "]", _
  SQLStatement:="SELECT * FROM [" & tblName & "]"

I have a query that I created in my project that I just saved out to a temp mdb file which I then used in the mail merge. You can probably get around this but I just threw it together real quick.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

616 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question