Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Automated Mail Merge without confirming data source

Posted on 2006-10-31
4
Medium Priority
?
325 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
[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
  • 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 2000 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

721 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