Thanks for the info Peter! I had tried to do this before without success.
After I saw this post I went back and figured out why I was having problems
making a separate connection to the DB. I was using SqlConnection when the
connect string from the mail merge was using OleDBConnection. So once I
realized that, I was able to make the new connection without any problems.
Thank you very much for your help!
I have one other question. I'm using a do while loop to step through the
records using ThisDocument.MailMerge.DataSource.ActiveRecord = Word.
WdMailMergeActiveRecord.WdNextRecord in order to update the DB. The problem
with this method is that every time I reassign .ActivRecord the mail merge
query refreshes which takes a second or two. This causes increasing delays
as the data set I'm working with grows. Do you know if there is another way
to access the mail merge records without using .ActiveRecord?
Thanks!
Derek Nishino
>As far as I know you cannot use the Mailmerge object to update the DB. You
>need to open a separate connection using e.g. ADO and do the updates using
[quoted text clipped - 43 lines]
>> P.S. To reply to me via email remove the 'NOSPAM' string from the
>> address.
> I have one other question. I'm using a do while loop to step through the
> records using ThisDocument.MailMerge.DataSource.ActiveRecord = Word.
[quoted text clipped - 3 lines]
> as the data set I'm working with grows. Do you know if there is another way
> to access the mail merge records without using .ActiveRecord?
Only the one I suggsted earlier - if you were using VBA there's a Word
MailMerge event that will fire either before or after each record is merged.
I imagine these events are available when you are using the VS, but I don't
know off the top of my head. The main problem with this approach is that if
multiple records are being consumed for each "pass" of the merge (e.g. if
you are using { NEXT } fields, doing label merges (same thing) etc.) you
will probably still need to have a way to identify which records to mark.
--
Peter Jamieson - Word MVP
> Thanks for the info Peter! I had tried to do this before without success.
> After I saw this post I went back and figured out why I was having problems
[quoted text clipped - 62 lines]
> >> P.S. To reply to me via email remove the 'NOSPAM' string from the
> >> address.
Derek Nishino - 30 Dec 2003 23:55 GMT
Thanks Peter! I'll give that a shot.
Derek Nishino
>> I have one other question. I'm using a do while loop to step through the
>> records using ThisDocument.MailMerge.DataSource.ActiveRecord = Word.
[quoted text clipped - 102 lines]
>> >> P.S. To reply to me via email remove the 'NOSPAM' string from the
>> >> address.