Replace WORD MailMerge Field

  • Thread starter Thread starter Brian McGuigan
  • Start date Start date
B

Brian McGuigan

I want to find the location of specific Word MailMerge
fields inside a document template and replace them with
specific values passed from an Access 2002 application. I
can find my own placeholders, but I want to use a template
normally used for mail merges to send 1 off HTMl emails,
without going through the hassle of doing a mail merge.
So how do I locate and replace a MailMerge field?
 
My solution does not email...but it certainly lets you send ONE record to a
word document, and the resulting document is "field free".

Ie: the resulting document is totally text..and no merge fields are in the
doc.

You can grab and try my word merge...(it has sample data).

My example allows you to create standard word merge documents with merge
fields...but then YOU can send ONE (or many) records to the document.

You will find it here:
http://www.attcanada.net/~kallal.msn/msaccess/msaccess.html


The above may not solve your problem...but in effect, I don't look for mail
merge fields...but simply feed the template the data..and MERGE the document
to plain word document (with no merge fields in it). So, kind of the same
effect you are looking for.
 
Hi Brian,

A mailmerge field is a member of the document's Fields collection, with
a type of wdFieldMergeField (=59). Having found one you can examine its
Code property: this will include the name of the data field it's linked
to.
 
Thanks John,

That looks like exactly the sort of information we were
after. It is important that we use the mail-merge
document as the source of the boiler-plate text, as we
want to be sure that we use exactly the same text in our
mail-merges as we use in our one-off documents.

Regards
Brian McGuigan
-----Original Message-----
Hi Brian,

A mailmerge field is a member of the document's Fields collection, with
a type of wdFieldMergeField (=59). Having found one you can examine its
Code property: this will include the name of the data field it's linked
to.

I want to find the location of specific Word MailMerge
fields inside a document template and replace them with
specific values passed from an Access 2002 application. I
can find my own placeholders, but I want to use a template
normally used for mail merges to send 1 off HTMl emails,
without going through the hassle of doing a mail merge.
So how do I locate and replace a MailMerge field?

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.
 
Back
Top