Weird Merge Problem (Win 2KPro, Office2KPro)

I have a list of contacts in outlook and want to update the d-lists. At first I thought of just creating a Mail Merge from Outlook to Word and set the query conditions in Word (which is often not a good idea) and, not suprisingly, the query setup did not find all the records it should have found. So I used Access (to which I can port the Outlook data) and set up queries to find the records desired. Access is a better choice anyway as I can use the DISTINCT keyword to keep multiple records from displaying. Then I set up the Mail Merge file in Word to point to the Access query. Now for the strange bit:

It seems that the same records that Words' anemic query options doesn't see also get dropped when applying an Access query directly to the Mail Merge file! Since I already have the query conditions set in Access, I thought it would just serve as a source for the Mail Merge file, but it apparently doesn't. Now, when I go in and re-attach the Access query in the mail merge file and uncheck the 'Link to Query' option, Word complains that the SQL is too complex. It'll still try to merge but records get dropped.

Specifically, the Word merge from the Access query yields 50 records and the Access query yields 99, so about 1/2 the records get dropped.

Any ideas? I could just create a make-table query and use the table as the merge source. However, this behaviour (Word not reading an Access query correctly)strikes me as very undesireable. I'm trying to make a roundabout process (updating Dlists) more automatic so it would be great to go thru as few steps as possible.

Re: Weird Merge Problem (Win 2KPro, Office2KPro)

Did you start by using the Address Book as the data source and the Query Options dialog to restrict the records returned? What was your query and what was omitted? Well, actually I don't want to know 49 data points, I'm wondering if you can see any systematic behavior there.

On the second point, unlike MSDE, Access can't be a server in this scenario, can it? Does DDE make that possible? You have to be using ADO/ODBC or OLEDB if you're running a query, I think. Where do you think the breakdown is in this process? You might just want to get the data with VBA and then spray it onto your document manually. More work coding, but much better control of sorting and grouping...

Re: Weird Merge Problem (Win 2KPro, Office2KPro)

Something strange appears to be going on here - we routinely do mail merges from Access queries using DDE and have never detected missing records. Why are you unchecking the "Link to Query" option? That is the part that should make the result dynamic - otherwise it simply creates a table in Word that it uses, and that probably results in the same issues you saw in Word.

Re: Weird Merge Problem (Win 2KPro, Office2KPro)

Here's how I try and merge the data from Outlook directly in to Word:

1) Open the contacts folder in Outlook and do Mail Merge in Outlook (this has the necessary advantage of pulling in some custom fields on the contact form)
2) Link the Mail Merge request in Outlook to a Word file
3) Outlook exports the Contact folder info to the Word file as a Mail Merge source
4) In Word, set up the following conditions for the Output:
CRCGType = CRCG AND MemberType = Chair AND Email IS NOT BLANK
result: 52 records.

Now I double-check this result from Access. Because it is possible to have more than one CRCG Chair listed by these criteria (you may have one person serving as chair for different counties) the SQL has to include DISTINCT to eliminate duplicate response. Result in Access is 99 records. I can take both results and put them in an Excel file for line-by-line comparison and what seems to be happening is the Word Mail Merge drops every other record.

As to using Access as the Word Mail Merge Souce, that just involves invoking the Mail Merge dialog box and setting an Access query as the source. I believe merging in Word is a DDE operation. However, using Word to merge from an Access query which, in Access, yields 99 records gives, in Word, exactly half that because every other record is dropped!

Re: Weird Merge Problem (Win 2KPro, Office2KPro)

You can see additional details on the problem I am reporting in this thread. As to unchecking the Link to Query option, I just did that to see what would happen as i was getting no light from the process as it ran. Normally I leave the option checked -- but when I didn't in this case Word protested that the SQL query was too complex. Here is the Access SQL:

<font color=448800>SELECT DISTINCT tblOutlookContacts.FullName, tblOutlookContacts.MemberType, tblOutlookContacts.CRCGType, tblOutlookContacts.Email1Address
FROM tblOutlookContacts
WHERE (((tblOutlookContacts.MemberType)="chair") AND ((tblOutlookContacts.CRCGType)="crcg") AND ((tblOutlookContacts.Email1Address)<>""))
ORDER BY tblOutlookContacts.FullName;
</font color=448800>

The very strange thing is, with the Link to Query checked or not, Word only finds every other record when running the mail merge.

Re: Weird Merge Problem (Win 2KPro, Office2KPro)

PROBLEM SOLVED

I should have thought of this before since it has occurred some time ago. The problem was NOT in the way Word is merging (from whatever source) -- the problem was how I set up the mail merge fields in the merge file. I had set it up like this originally:

Re: Weird Merge Problem (Win 2KPro, Office2KPro)

That's the first that came to mind with "every other record" and even when you know this can happen, the logic of merge fields is just not very logical. <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>