You're talking about a lot of coding to mimic built-in functionality. You
say you want to stay in Word -- it can't be for ease of query manipulation,
so it must be for formatting reasons.
Why not use Access to generate the mail merge as a report, export/save the
report to Word and then do your cosmetic work there?
Thanks for the sanity check, Chuck. Sometimes you can't see the wood for the
trees! You're right, sticking with Word is mainly about formatting, as well
as consistency with other elements and user comfort. So what I now propose
is:-
Create report from each query.
Create macro (using OutputTo action) to export the reports as rtf,
specifying save filenames.
In my mail merge source table in Word, I have inserted the field "Insert
text" as a link to the rtf file.
Now, with some additional cosmetics in my mail merge main doc, I have a nice
result.
This is certainly much more effective; the only issue is that, when I run
the macro, I get asked if I want to replace the existing file. The answer is
"Yes" every time. I realise this is probably controlled by the Access Macro,
which may not be your forte.
Can you help with this minor aspect, and is there anything else I'm being
dumb about?
Many thanks
> You're talking about a lot of coding to mimic built-in functionality. You
> say you want to stay in Word -- it can't be for ease of query manipulation,
[quoted text clipped - 35 lines]
> > with Word for the time being for various reasons. Thanks for your indulgence
> > and help.
Chuck - 09 Mar 2005 13:09 GMT
To avoid the overwrite file prompt when saving the new report, you'll
probably need to run the KILL command to delete the existing file before
saving the new one.
As for simplifying the merge process. Assuming that your merge information
is in your database, you could set up your merge letter as a report, with the
table query results as an embedded sub-report, with the sub-report's results
filtered based on the each record in the main report. That way you could set
up your query-report-export as a single command (button) and open the
resulting RTF in Word for final cosmetic touches, without having to run a
separate merge in Word. They key thing is to design your query(ies) for the
sub-report to include fields that match identifying (key) fields in the main
report, so the sub-report receives it's filter criteria from the main report.
HTH
Chuck
> Thanks for the sanity check, Chuck. Sometimes you can't see the wood for the
> trees! You're right, sticking with Word is mainly about formatting, as well
[quoted text clipped - 58 lines]
> > > with Word for the time being for various reasons. Thanks for your indulgence
> > > and help.
Archie - 09 Mar 2005 21:55 GMT
Thanks for the tips, Chuck. I'll give your suggestions about the sub-reports
a try.
As a point of interest, when I use a macro with OutputTo, I get the error
message about replacing the existing file. However, I now find that when I
run this from a module as DoCmd.OutputTo, there is no message and it does
overwrite, so all's good.
Thanks again for your input; this is a great community!
> To avoid the overwrite file prompt when saving the new report, you'll
> probably need to run the KILL command to delete the existing file before
[quoted text clipped - 75 lines]
> > > > with Word for the time being for various reasons. Thanks for your indulgence
> > > > and help.
Chuck - 10 Mar 2005 11:19 GMT
You're welcome -- I've had a lot of great help here myself.
> Thanks for the tips, Chuck. I'll give your suggestions about the sub-reports
> a try.
[quoted text clipped - 85 lines]
> > > > > with Word for the time being for various reasons. Thanks for your indulgence
> > > > > and help.