Solved

Automated Mail Merge without confirming data source

Posted on 2006-10-31
4
293 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
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…

803 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