473,382 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Access 2003 to Word 2003 Mail Merge

3
Help!!!

What am I doing wrong? I am working with Office 2003 and am trying to create a command button on an Access form that will create a mail merge in Word from an Access table.

I want to make the mail merge seamless to the user so all they have to do is click on the command button and the letters are generated.

For the button I created an event procedure with the following code:

Private Sub RunLetters_Click()

Dim objWord As Word.Document
Set objWord = GetObject("C:\Temp\Download\Access to Word\MERGE LETTER.doc", "Word.Document")

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

'Set Mail Merge Data Source
objWord.MailMerge.OpenDataSource NAME:="C:\Access2003\RonWorkingOn\Copy of NewVersion.mdb", _
LinkToSource:=True, _
Connection:="TABLE LETTER SENT PULL TABLE", _
SQLStatement:="SELECT * FROM LETTER SENT PULL TABLE"

'Execute the mail merge.
objWord.MailMerg.Execute

End Sub

When I click on the button I always get a Microsoft Office Word message box that says:
Opening this document will run the following SQL command:
SELECT * FROM [LENDER SENT PULL TABLE]
Data from your database will be place in the document. Do you want to continue?

I click on Yes then after a short wait Word opens and the master merge letter opens and I get another message box that says:
Confirm Data Source
OLE DB Database Files
MSAccess database via DDE(*mdb.*mde)
MSAccess database via ODB(*.mdb)

When I pick the 1st choice - nothing happens and I close Word and am back in Access and have a Microsoft Visual Basic message box that says:
Run-time error 4198
Command failed

When I pick the 2nd choice - again nothing happens and I close Word and am back in Access and have another Microsoft Visual Basic message box that says:
Run-time error 5922
Word was unable to open the data source

When I pick the 3rd choice - a message box comes up asking me to pick the Table and I click on the desired table.

Again the same thing happens as when I pick the 2nd choice.

Can anyone please help me? I have tried everything I could find and nothing is working.

Thanks,

Ron
Nov 3 '06 #1
8 13311
southoz
24
check your PM's for an answer


southoz
Nov 4 '06 #2
PEB
1,418 Expert 1GB
It's interesting to have the answer also in the forum :)
check your PM's for an answer


southoz
Nov 4 '06 #3
MMcCarthy
14,534 Expert Mod 8TB
Try changing this line to:

SQLStatement:="SELECT * FROM [LETTER SENT PULL TABLE];"
Nov 7 '06 #4
Ron B
3
To southoz,

Thanks for your reply. Unfortunately when I try to go to members.dodo.com/au/gjevers/gregw.zip I get Page does not exist.

Have I got the url wrong?

Ron
Nov 10 '06 #5
Ron B
3
To mmccarthy,

Thanks for your recommendation. I tried it and it did not work either.

I am desperate for any ideas so if you have any more please send them.

Thank again,

Ron
Nov 10 '06 #6
MitchR
65 64KB
Does Word 2003 have to house the form letter .... i have script that will generate a text email and send with you respective data from the form ....
Nov 10 '06 #7
southoz
24
Good ay Ron B

I have posted the code to this forum follow this link http://www.thescripts.com/forum/thread559954.html

I also have the fall demo database on my site http://members.dodo.com.au/gjevers/gregw.zip

hope this helps
southoz
Nov 10 '06 #8
NeoPa
32,556 Expert Mod 16PB
Good 'ay SouthOz.

That's a good way to provide the answer - a reusable thread - I like it.
Nov 11 '06 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: bmoos1 | last post by:
I have MS Office 2000 and upgraded Access Only to 2003. The problem is I want to use my Access queries for a mail/merge, but I get the error message: "Word could not re-establish DDE...
0
by: jwa6 | last post by:
We have recently went to access 2003 from access 97. And from word 97 to Word 2003. We have an Access application we use for ms word mail mergers to a 5160 mail label format. The data for the...
9
by: Neil Ginsberg | last post by:
I have a strange situation using Access to automate a Word mail merge. Using Access 2000 and Word 2000, the code opens Word, opens the document in Word, sets a table in the calling Access...
3
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge...
4
by: pmhaupt2 | last post by:
I developed an Access 2003 program that will allow the user to produce a group of Word letters that merge with data records from an Access database. I created a mail merge Word document and...
4
by: Access | last post by:
Okay I know this is probably not the best way to be doing things but I have an ancient application that was working fine until a end user got a new machine. The Access database is performing a...
0
by: pnr | last post by:
I transferred my database to a new computer. I can open it in 2003 Access, but am keeping it in the 2000 version until I get it working correctly. I have dozens of Word documents where I use...
0
by: Darragh | last post by:
I'm encountering some serious problems trying to set Access 2000 querys (parameters and views) as data sources for my mail merge documents (Word 2003). After spending hours scouring the web for...
1
by: damezumari | last post by:
I use MS Office 2003 and would like to run several Word mail merges from Access. My code so far is given below. 1. The code does not do what I want. I want to save the new document with the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.