Re: conditional macro at end of merge
- From: slickdock@xxxxxxxxx
- Date: Tue, 14 Oct 2008 18:26:24 -0700 (PDT)
On Oct 13, 2:44 pm, "Doug Robbins - Word MVP"
<d...@xxxxxxxxxxxxxxxxxx> wrote:
If I had to do something like this, I would not use mailmerge as the basis.
Rather, instead of using a mailmerge main document, I would create a
template that had {DOCVARIABLE} fields where you would have had mergefields
in a mail merge main document and then I would use VBA to iterate through
the Access Table/Query, creating a new document from the template for each
record and creating variables in that document that would contain the data
from each field in that record. The code would also call the macro to be
executed on that document if there was one in that field of the record.
--
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
<slickd...@xxxxxxxxx> wrote in message
news:636c781f-cc53-4421-84fa-c1b1c09fffed@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a generic MSAccess module that starts MSWord and merges a form
file with a data file. I create the data file through a TransferText
command that stores the MSAccess record as a text delimited file.
I want my Access module to further handle this requirement:
If [NameOfAdditionalMacroNeeded] field from the data file is not
blank, find the macro by that name in the user’s MSWord normal.dot
and
execute it at the end of the merge.
Access groups are telling me to go to this group for help.
Can anyone help? Thank you. I'm a rookie at VBA, so please go easy
on
me!
Thank you Doug. I am currently exporting the data from the selected
record into a text file to merge with my Word mail merge doc. To use
your solution, would I still be merging, or populating my template,
with these fields in the text file? Or would I have to change my
technique and store the desired record in a temporary table in Access,
populating the template with that?
I have never worked with templates. Can you point me to some examples?
.
- Follow-Ups:
- Re: conditional macro at end of merge
- From: Doug Robbins - Word MVP
- Re: conditional macro at end of merge
- References:
- conditional macro at end of merge
- From: slickdock
- Re: conditional macro at end of merge
- From: Doug Robbins - Word MVP
- conditional macro at end of merge
- Prev by Date: Re: Embed pulldown menu in a document
- Next by Date: Re: Making a help system for a word.dot
- Previous by thread: Re: conditional macro at end of merge
- Next by thread: Re: conditional macro at end of merge
- Index(es):
Relevant Pages
|