mail merge

  • Thread starter Thread starter H
  • Start date Start date

H

Registered User.
Local time
Today, 18:43
Joined
Sep 3, 2001
Messages
11
got a small problem i have created a mail merge that creates a letter, but i want to put a button on the form that will automatically open the letter on the correct record when clicked

thank you
 
Assumedly, the 'correct record' is the one displayed on the form?

if so, this is how I do it:

1. Build a maketable query that creates a temporary table which holds only the record you want to merge with.

2. Set the mailmerge to merge with the temporary table

3. Use the shell statement to open the doc

Shell("PathToFile")

3a. Set word to either automatically show the fields values using the 'ABC' button on the mailmerge toolbar or alternatively record a macro that merges the data and put that in the Document_Open sub.

4. Delete the temporary query either manually or use:

Docmd.DeleteObject acTable "TempTableName"

It is best to delete the table right after it's fulfilled it's purpose to eliminate unnecessary database bloat.

Alternatively, you can use code to reference the Word Object Library and manipulate word from there to show only the record you require. However, that might be a bit deep as your question didn;t sound like you were code-minded (no offence).

Ian
 

Users who are viewing this thread

Back
Top Bottom