473,485 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Mail merge to letter in Word 2007

16 New Member
I would like to set up a button on an input form which will merge the contact information from the current record into a word document. I have set up the merge fields in the word document from a query. The word document is a letterhead and is saved in the following location:

X:\AVK UK\Global Reports - DCF's etc\Customer Complaints\Letterhead DO NOT USE


I have set up a query which pull the data needed for the merge into a query called:

"qryCustomerContact"

This query has the following fields:

CC Number (set up to look at current form record only)
Customer Name
Address1
Address2
Address3
Town
County
Postcode
Contact Name
Position


I want to be able to press a button on my form which opens the word document and updates the fields.

I know how to use mail merge from access but have never made this process automatic using vba so are in desperate need of HELP.

I look forward to receiving your replies.

If you need anymore information about my database please just ask.

Thank you
Jun 14 '10 #1
4 2896
patjones
931 Recognized Expert Contributor
I had a feeling that this topic seemed familiar to me. Indeed, we looked at this issue back in April.

Are you still using the code you posted in the first thread, and if so, is Word at least opening up?

As I pointed out at then you need to tell Word where to look. It seems like it's a question of Word not being able to find where your data is.

Pat
Jun 14 '10 #2
jolaunt
16 New Member
I am at a complete loss as to who to make this work. I think I need to start from scratch with this coding.

I have been able to get word to open the correct document but like you say it doesn't seem to know to look in the query to update the fields.

Any help at all on how to make this happen would be FANTASTIC!

As I have mentioned before I am quite new to vba coding and think I am being a bit ambious in trying to figure this one out myself.

Thanks
Jo
Jun 15 '10 #3
patjones
931 Recognized Expert Contributor
Well let's talk this out a little bit.

As I think I mentioned in the other thread, my feeling is that this doesn't have as much to do with the VBA as it does with what is going in the Word file. The purpose of the VBA is to open the Word document, which it does. I think the problem may just have to do with the Word document.

I have used the mail merge feature in Word quite a bit, but I have discovered that there are a couple steps to take to make sure the merge happens correctly. Namely, it is necessary to take steps in the Word document:
  1. Select Recipients > Use Existing List...
  2. Insert Merge Field
  3. Update Labels
  4. Preview Results
It seems like you have done the first two steps already. Perhaps when the document opens you need to update the labels and preview the results? Since VBA is available in Word, this process could be automated, if in fact the issue is as simple as this.

Pat
Jun 15 '10 #4
jolaunt
16 New Member
Thanks - I have managed to get it work now!!

You have been a great help.
Jun 17 '10 #5

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

Similar topics

1
3150
by: Morris | last post by:
Does anyone know whether it is possible to effect a mail merge to MSWord using VBScript in an asp file? I know it is possible to produce a doc file and force a download using ...
4
8847
by: Tom Dauria | last post by:
I have an application that will be distributed remotely. In the Access application I am opening Word documents and mail merging. The Word documents are linked to a tmpLetter table. In my code I...
2
3225
by: Aaron | last post by:
hello, i am perfoming a mail merge with the following code. Public Function MergeIt() Dim objWord As Object Set objWord = GetObject("C:\MyMerge.doc", "Word.Document") ' Make Word visible....
8
5146
by: Darryl Kerkeslager | last post by:
I hope that although this is 25% Access and 75% Word, that someone will know ... The whole problem here arises because 1) Microsoft acknowledges an 'issue' wherein TextInput type FormFields are...
2
3397
by: gtslabs | last post by:
I have searched the archives for answers with no luck. I am now using Access 2003 from Lotus Approach. I see that Access does not have any built in envelope or mailing lable features. I want to...
6
4628
by: crealesmith | last post by:
Firstly, I have no problem with mail merging to Word, VB code for that works perfectly. On one mail merge I need to merge 15 fields of data that are from 3 seperate records. The 3 records are all...
2
2288
by: Phil Stanton | last post by:
I am using Access 2000 to email invoices to clients as attachments (in PDF format). In addition I want to attach a personalised letter (Word 2000 mailmerge). The email SendTo, invoice details and...
2
3321
by: jojopangit | last post by:
hi, i have the following command and generated an error : "word was unable to open the data source" any help will be greatly appreciated. Thanks in advance. Jude Private Sub...
1
5033
by: kayberrie | last post by:
I want to write a VBA mail merge code. I want to link the code/macro/dohicky to a nifty little button so it makes life easy. I think I can handle the button part, the code part - not so much. I know...
2
4307
by: mjvm | last post by:
HI again, I am trying to use the mail merge to word wizard under External Data from a query and this is what happens: On opening Word, I get an error message called: ODBC Microsoft Access...
0
7090
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
6825
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7275
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5418
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4857
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4551
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1376
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
595
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.