Just an observation... my own experience of doing this kind of thing (which
is rather outdated now) is that Word probably has at least one memory leak
that will appear no matter how you split up a large merge. It may be worth
trying to do multiple merges using a script that starts word, does the
merge, closes word and so on, but that's not particularly easy either.
Unless you are having problems with specific .txt files...
Peter Jamieson

Signature
Peter Jamieson
http://tips.pjmsn.me.uk
Thanks for your comments, I've tried the one-merge-per-invocation and
that helps.
I'm running Word from a perl script, and I thought there might be some
funny business going on with this setup, another reason I tried the
one-merge-per-invocation thing. The perl script basically does this,
once per data source file:
my $wrd = Win32::OLE->new('Word.Application');
$wrd->Run($MACRO);
$wrd->Quit();
Another thing I thought of: my system has both Word 2000 and 2003
installed, so I'm wondering if there's any interference between the two
installations. Running on a single-install system seems to help.
Also, each of my data source files contains the header record as the
first line. Does this ring any bells?
Thanks again.
> Just an observation... my own experience of doing this kind of thing
> (which is rather outdated now) is that Word probably has at least one
[quoted text clipped - 6 lines]
>
> Peter Jamieson
Peter Jamieson - 28 Aug 2007 21:30 GMT
> Also, each of my data source files contains the header record as the first
> line. Does this ring any bells?
Not really, but it's possible that WOrd is using different methods to read
the .txt files - with Word 2003 it would be a choice between its internal
text converter, and an OLE DB provider. Although I would expect that it
would /always/ read the same file using the same method, if your file
content is changing over time, that method might change for each file from
merge to merge. Precisely why that would cause a problem I do not know, but
perhaps for example one method is leakier than another.
However, the chances are that that's a red herring.

Signature
Peter Jamieson
http://tips.pjmsn.me.uk
> Thanks for your comments, I've tried the one-merge-per-invocation and that
> helps.
[quoted text clipped - 27 lines]
>>
>> Peter Jamieson