?
Solved

Recordset to mailMerge???

Posted on 2003-03-07
1
Medium Priority
?
297 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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
Course of the Month8 days, 3 hours left to enroll

765 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