Solved

Automated Mail Merge without confirming data source

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server functions 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 Microsoft Ac…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

895 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

16 Experts available now in Live!

Get 1:1 Help Now