newer versions of Word take longer to merge

M

MattD

Compared to Word 97 and 2000, Mail Merge in word 2002 and
2003 take MUCH LONGER. Is there a way to get this to
take less time? Merging a single document could take as
long as 30-60 seconds (one page document). The same
document with the same data source on 97 or 2000 takes
less than 5 seconds.

The problem occurs on this statement:
ActiveDocument.MailMerge.Execute
We use ODBCs to connect to our database, using the dBase
Driver DSN. The data source is populated by our
client/server app to a local .dbf file.

Suggestions? Why would Word version drastically change
the merge speed?
 
C

Cindy M -WordMVP-

Hi MattD,

I see you've posted this twice, no answer...

Are you absolutely certain this is an ODBC connection, and
that OLE DB isn't kicking in here? Are you using Word's
default connection, or selecting the DSN entry explicitly,
when connecting to the data source?
Compared to Word 97 and 2000, Mail Merge in word 2002 and
2003 take MUCH LONGER. Is there a way to get this to
take less time? Merging a single document could take as
long as 30-60 seconds (one page document). The same
document with the same data source on 97 or 2000 takes
less than 5 seconds.

The problem occurs on this statement:
ActiveDocument.MailMerge.Execute
We use ODBCs to connect to our database, using the dBase
Driver DSN. The data source is populated by our
client/server app to a local .dbf file.

Suggestions? Why would Word version drastically change
the merge speed?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun
8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
G

Guest

I wanted to clear up one thing I had stated in the
original problem --
The problem occurs on this statement:
ActiveDocument.MailMerge.Execute
We use ODBCs to connect to our database, using the dBase
Driver DSN. The data source is populated by our
client/server app to a local .dbf file.
should be :
The problem occurs on this statement:
ActiveDocument.MailMerge.Execute
We use ODBCs to connect to our database, do a select
statement, then pass the results
along with the location of a .dbf file containing the
result structure.
Thanks for your attention!
 
C

Cindy M -WordMVP-

The problem occurs on this statement:
ActiveDocument.MailMerge.Execute
We use ODBCs to connect to our database, do a select
statement, then pass the results
along with the location of a .dbf file containing the
result structure.
Unfortunately, I don't know of any way you can speed this
up. Usually, the problems we see come from the new, OlE DB
connections. Whatever might be going on behind the scenes
with your ODBC connection, I don't know of any way to
change what Word is doing. There aren't any settings or
anything one can change for how mail merge is executed.
However...
Merging a single document could take as
long as 30-60 seconds (one page document). The same
document with the same data source on 97 or 2000 takes
less than 5 seconds.
...this seems really a bit much. There are a few more
things I'd like you to test:

1. If run this merge by hand, rather than through code, do
you see the same behavior?

2. How about if you hold down CTRL when you start Word
(safe mode) and merge the existing main merge document?

3. And then to a new, blank document?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
M

MattD

It looks like we have solved the problem, and may have
identified a bug with Microsoft Word 2002.
The query line in macros do not behave the same in Word
2002 as it did in Word 97 and 2000, and 2003.
The SQLStatement:=_ "SELECT * FROM dba.mailmergedata" _
will actually select all records from the table (taking
quite a bit of time), then select the correct record
when the activedocument.mailmerge.datasource.querystring
= "SELECT * FROM DBA.MailMergeData WHERE (N_OWNERID=185)
ORDER BY lastname, firstname"
******************
So if we change this:
ActiveDocument.MailMerge.OpenDataSource
Name:="C:\Program Files\product\Temp\\PatVar.dbf",
ConfirmConversions:= _ False, ReadOnly:=False,
LinkToSource:=False, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="",
WritePasswordDocument:="", _ WritePasswordTemplate:="",
Revert:=False, Format:=wdOpenFormatAuto, _
Connection:="DSN=datasn;UID=UID;PWD=pwd", SQLStatement:=
_ "SELECT * FROM dba.mailmergedata" _ , SQLStatement1:=
_ ""
With ActiveDocument.MailMerge
.DataSource.QueryString = "SELECT * FROM
DBA.MailMergeData WHERE
(N_OWNERID=185) ORDER BY lastname, firstname"
.Destination = wdSendToNewDocument
(etc)
To this:
ActiveDocument.MailMerge.OpenDataSource
Name:="C:\Program Files\product\Temp\\PatVar.dbf",
ConfirmConversions:= _ False, ReadOnly:=False,
LinkToSource:=False, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="",
WritePasswordDocument:="", _ WritePasswordTemplate:="",
Revert:=False, Format:=wdOpenFormatAuto, _
Connection:="DSN=datasn;UID=UID;PWD=pwd", SQLStatement:=
_ "SELECT * FROM DBA.MailMergeData WHERE (N_OWNERID=185)
ORDER BY lastname, firstname" _ , SQLStatement1:= _ ""
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
(etc)
It doesn't do the additional selects from the entire
table. This change seems to also work fine in Word 97
and 2003 (I haven't tested in 2000 yet).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top