Re: Automate opening a merge with Mailmerge Recipients open

Tech-Archive recommends: Fix windows errors by optimizing your registry



To disconnect the data source, change the type of document from a mailmerge document to a normal Word document and then change it back to the desired type of mail merge main document. The merge fields will still be in the document.

As far as the "field mapping" is concerned, if by that it can be implied that you are not using the actual names of the fields from the data source, then it would be far better if you did use the data source field names directly as then no mapping would be required.


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"Graywolf" <Graywolf@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:C3DFDF26-EC03-4400-956D-F80C383092C2@xxxxxxxxxxxxxxxx
Thanks for responding Peter. I realize that you guys are volunteers, but a
lot of you have 'MVP' behind your name and you guys obviously know a lot more
than I do.
I tried using the querystring property of mailmerge and everytime I did I
seemed to lose the links to the fields. i.e. I would have to match fields
again in the merge document because all my original field mapping was lost
when the sql statement changed (even though the table and fields did not
change, only which records are selected for output). My most recent attempt
at getting this to work was to alter the underlying Access query. I open
Access through DAO and actually change the querydef in Access, save the
change, then open the Word merge document that's still pointing to the
datasource linked to the query, only now the query has been changed. This
seems to work a little better, because I don't seem to lose the field
mappings, but I'm still having problems getting the correct output.

How do you disconnect the datasource? and if I do, won't I lose my field
mappings again? and if I lose my field mappings, how do I reconstruct them
programmatically?
I wouldn't think this should be so difficult, what am I doing wrong? Do you
need to see a section of my VB6 code?

"Peter Jamieson" wrote:

> I'm having trouble getting things posted properly. My issue has
actually been
> posted twice.

A lot of people seem to have been experiencing difficulties with the
web-based interface. But please bear in mind that you are not talking to
Microsoft here - most of the people who answer questions are volunteers.

How are you trying to modify the query before opening the Word document?
Are you using e.g. an Access data source and actually modifying the
Access query code, for example? Or are you actually setting Word's
Mailmerge.Datasource.Querystring property?

What you may find is tht you actually have no option but to disconnect
the existing data source and use MailMerge.OpenDatasource to open it
again, with the query you need.

Peter Jamieson

http://tips.pjmsn.me.uk

Graywolf wrote:
> I'm having trouble getting things posted properly. My issue has > actually been
> posted twice. Please see and respond to my post for "Automate opening a > merge
> with Mailmerge Recipients open". And I'm using Word 2003 SP3, NOT Word > 97.
>
> "Graywolf" wrote:
>
>> I'm trying to automate a Word Mailmerge using VB6. I have an interface >> built
>> that allows the user to pick the type of document and I have basic
>> datasources defined for each document. In this specific example I'm >> doing a
>> merge for mailing labels. However, the end user needs to further >> refine who
>> gets a mailing label and who doesn't. I have built into the interface >> the
>> ability to pick and choose from the original query list the people who >> should
>> get a label. I can then change the underlying query before opening >> the Word
>> document. However, I can't seem to get the Word document to behave >> properly
>> and display my narrowed down list of recipients. All I can get to come >> up is
>> the full list (as if I never changed the underlying query). It appears >> that
>> if I alter the datasource in any way, then the merge breaks. So now >> what I
>> would like to do is just bring up the merge document with the full >> list of
>> recipients and have the "Merge Recipients" window open so the end user >> can
>> refine their list from Word instead of from my interface. How do I get >> the
>> merge to open with the "Merge Recipients" window opened up?


.



Relevant Pages

  • Re: Repeat a merge if a record exists or end if it doesnt
    ... Use a Catalog type ... mailmerge main document in which you have just ... I am trying to make a document in which my data source is a .txt document ... generated from an access query and exported. ...
    (microsoft.public.word.mailmerge.fields)
  • RE: word and access 2003
    ... Use Mailmerge to link your document to your database query and insert a merge ... Your access file will be your data source. ... "Patrick Stubbin" wrote: ...
    (microsoft.public.word.docmanagement)
  • Re: How to use mailmerge feature to generate report? (i.e. SQL statem
    ... Mailmerge can link to only one data source. ... Use a query to bring the ... The problem is that the report require data more than one tables, ...
    (microsoft.public.word.mailmerge.fields)
  • Mailmerge data source in an Access database will not open
    ... I am creating directory in Word 2003 by mailmerge using as the data source a ... When I attempt to browse to the data source I find that every table and query ... number of calculated fields. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: How to Merge data from an ascii file into a Word Doc
    ... The approach Graham originally suggested uses Mailmerge and Mailmerge fields. ... When your document is connected to a mailmerge data source and you re-open it, you get that SQL message. ... The approach I suggested and which Graham has added to does not rely on mailmerge, uses DOCVARIABLE fields rather than mailmerge fields, and does not result in the SQL message. ... Dim iCount As Integer ...
    (microsoft.public.word.docmanagement)