Word 2000 re-reading records for each field access

R

Richard

Is there any way to avoid this problem? I'm intervening in the
MailMerge process and want to return an entire record:
ActiveDocument.MailMerge.DataSource.ActiveRecord = wdNextRecord
But when I loop through the record to access each required field:
ActiveDocument.MailMerge.DataSource.DataFields("fieldname")
it seems Word re-reads the record each time. The latency is killing
me, regardless of the type of data source. I don't think I can use ADO
in Word 2000, and my DAO is too rusty to fall back on. Do I have to
discard this method entirely?
 
C

Cindy M -WordMVP-

Hi Richard,

I think I answered you somewhere else, some 15 hours ago... You can
certainly use ADO to get the data and pass it to the Word document
(rather than working through an attached mailmerge data source).
Is there any way to avoid this problem? I'm intervening in the
MailMerge process and want to return an entire record:
ActiveDocument.MailMerge.DataSource.ActiveRecord = wdNextRecord
But when I loop through the record to access each required field:
ActiveDocument.MailMerge.DataSource.DataFields("fieldname")
it seems Word re-reads the record each time. The latency is killing
me, regardless of the type of data source. I don't think I can use ADO
in Word 2000, and my DAO is too rusty to fall back on. Do I have to
discard this method entirely?

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 :)
 
R

Richard

Hi Cindy,

Sorry if I missed your answer. And thanks, for this one and all the
other great info you've put on the web on Mail Merge etc.
 
J

John Beschler

Cindy,

Do you know of a KB article that gives an example of doing this? I can
handle the ADO, as I use that regularly; however, I'm not sure how to
correlate the data in the source with the placefields (for lack of a better
term) in the document.

I suspect one way would be to simply create my own markers using some unique
code in the document and then search for those markers as I process the ADO
file. Is there a better way?

Thanks,
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?Sm9obiBCZXNjaGxlcg==?=,

Generally, when automating data input into Word, we use BOOKMARKS as the
target. There are any number of example around how that is done. The question
is, do you have any control how these documents are created? Or are you having
to work with existing mail merge documents, targeting the mail merge fields?
Do you know of a KB article that gives an example of doing this? I can
handle the ADO, as I use that regularly; however, I'm not sure how to
correlate the data in the source with the placefields (for lack of a better
term) in the document.

I suspect one way would be to simply create my own markers using some unique
code in the document and then search for those markers as I process the ADO
file. Is there a better way?

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 :)
 
J

John Beschler

Cindy M -WordMVP- said:
Hi =?Utf-8?B?Sm9obiBCZXNjaGxlcg==?=,

Generally, when automating data input into Word, we use BOOKMARKS as the
target. There are any number of example around how that is done. The question
is, do you have any control how these documents are created? Or are you having
to work with existing mail merge documents, targeting the mail merge fields?


Well, that's not entirely set in stone. We have some existing documents
that were converted from XyWrite using a VBA program I wrote. They already
have mail merge fields in place. However, there will always be a need for
new forms and in those instances we could certainly use bookmarks. I suspect
that the mailmerge would process faster, but using ADO and bookmarks may give
us more flexibility.
 

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