Solved

Automated Mail Merge without confirming data source

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why this Update SQL not Updating! 15 57
Fields don't match on a query 9 47
Export individual report to pdf 2 41
Outlook mail to Access 8 31
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
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…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

752 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