Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mailmerge and 2 addresses

Status
Not open for further replies.

Fadius

IS-IT--Management
Jul 25, 2001
139
US
I have a query with the result in a table that the application creates and this is used for the mail merge.

In this table there will be 2 lines for each person.

One line will have the persons office address.

The second line will have the home address.

Both lines will contain the persons name.

I need to print a letter for each person that will contain both addresses next to each other in the main part of the letter using mail merge.

Any help would be greatly appreciated with accomplishing this.
 
I would suggest you output the query result to Excel file, and combine the two records into one row, OR, change your SQL query to build the second address in the cursor/table beforehand. Dealing with a a mail merge with multi-row, in one page is going to be very difficult. This will simplify your life a lot.

Once you get it to Excel, and you have 1 row with twice the number of columns, it is then very easy to assign different field value to each, and merge to your Word doc.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 


hi,

In Excel, query the table using SQL like this...
Code:
Select A.person, A.HomeAddress, B.OfficeAddress
From YourTable A, YourTable B
Where A.person=B.person
Use this resultset as the source for your merge.


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
So there is no way to do this from the one existing table in word? I ask as I need to upload the letter into the application so the users can run it and mail it.

This needs to be as easy for the users to run as possible.
 



No.

Each row is ONE merge!

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
If I'm understanding correctly, each record contains two rows, and Column 1 of each row contains the persons names.

Q: In each record's two rows, are the names formatted exactly the same?

If so, you could:

1. Change your form type from Letter to Directory.

2. Insert a borderless, 1-row, 3-column Table where you want the addresses listed in the form letter.

Cell 1 is for the 1st address of the Person.
Cell 2 is empty (for space between the two addresses).
Cell 3 is for the 2nd address of the same Person.

3. Then follow the example shown at to modify your merge fields for a directory merge.

This will instruct Word to compare the name in the first row with the name in the next row.

If they match, Word will merge the first row's data into Cell 1 (first address of Person 1) and the next row's data into Cell 3 (second address of Person 1).

If they don't match, Word will begin a new letter and continue until all the letters have been created.
 
Hi Fadius,

The catalog/directory mailmerge route is more trouble than it's worth, especially if there will be more merges in the future.

Your problem is that your data have not been laid out to suit a mailmerge, which requires one line per record. Ideally, you should correct the data at its source. In that regard, you could add a new worksheet to your existing workbook, wherein you could use formulae or a macro to re-arrange the data into an appropriate merge layout.

If you want to persist with a catalog/directory mailmerge approach, check out my Microsoft Word Catalogue/Directory Mailmerge Tutorial at:
or
Do read the tutorial before trying to use the mailmerge document included with it.


Cheers
[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top