Word 2003
(1)
VB
(1)
FormFields
(1)
Datasource
(1)
Fellow
(1)
Merges
(1)

Need merge doc to run a macro

Asked By Graywolf
22-Jan-10 07:30 PM
I am running Word 2003 SP3. I have  a VB6/SP6 program that runs some queries
to get the needed data and then it takes a Word Merge document, connects it
to the datasource, and merges the data. It all works fine. Now I need to
enhance the merge. Part of what the VB program does is build a table in the
merge document that is basically a checklist. I need to have some of the
items in the checklist 'pre-checked' if you will. If every letter of the
merge had the same prechecked items it would be no problem, but I need to
change the prechecked items on each letter based on the recipient of the
letter. I thought I could create a macro in the merge document that would run
for each record merged and let the macro build the checklist and either check
or leave unchecked the items on the list based on the record being merged.
That macro would need to reference merge fields. Have no idea how to get
macro to run for each merge record, and do not know how to reference the merge
fields in the macro to do 'if..then... else' statements, etc.
Any help would be greatly appreciated. Thanks in advance.

Instead of executing the mail merge, you might consider a variation of

Doug Robbins - Word MVP replied to Graywolf
22-Jan-10 09:19 PM
Instead of executing the mail merge, you might consider a variation of the
method in the article ???Combining FormFields and Mail Merge??? on the following
page of fellow MVP Graham Mayor???s website:

http://www.gmayor.com/Form_Fields_and_Mail_Merge.htm

There might also be some code of interest to you in the article on  the
following page of fellow MVP Graham Mayor???s website:

http://www.gmayor.com/ManyToOne.htm


--
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
Post Question To EggHeadCafe