Solved

Automated Mail Merge without confirming data source

Posted on 2006-10-31
4
272 Views
Last Modified: 2012-06-21
I have a mail merge that is automatically generated from Access which works fine. If possible though, I'd like to get rid of the "confirm datasource" message that pops up. I know which datasource to pick, but my users won't and I'm afraid this will just confuse them. Here's my merge code, shamelessly plagarized from Microsoft:

    Dim objWord As Word.Document
    Set objWord = GetObject("T:\DATABASE\Client Case Blurbs.doc", "Word.Document")

    ' Make Word visible.
    objWord.Application.Visible = True

    ' Set the mail merge data source
    objWord.MailMerge.OpenDataSource Name:="T:\DATABASE\Clients.mdb", _
    LinkToSource:=True, _
    Connection:="TABLE ExportBlurbsTable", _
    SQLStatement:="SELECT * FROM [ExportBlurbsTable]"

    ' Execute the mail merge.
    objWord.MailMerge.Execute

Any suggestions?
0
Comment
Question by:TheBaroness
  • 2
  • 2
4 Comments
 
LVL 44

Expert Comment

by:Leigh Purvis
ID: 17844812
What version of Word/Access?
0
 

Author Comment

by:TheBaroness
ID: 17844831
Both are XP ... although I default to the 2000 version of Access, if that matters.
0
 
LVL 44

Accepted Solution

by:
Leigh Purvis earned 500 total points
ID: 17848239
Hi again.  OK.

It's likely trying to use OLEDB to perform the merge.
You could try dropping back into DDE mode...

objWord.MailMerge.OpenDataSource Name:="T:\DATABASE\Clients.mdb", _
    LinkToSource:=True, _
    Connection:="TABLE ExportBlurbsTable", _
    SQLStatement:="SELECT * FROM [ExportBlurbsTable]", _
    SubType:=wdMergeSubTypeWord2000

Or we can try to keep it in OLEDB if you want...
0
 

Author Comment

by:TheBaroness
ID: 17849809
That's exactly what I needed! Thanks so much!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now