Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / August 2003

Tip: Looking for answers? Try searching our database.

Problem with including recipients to mail merge

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gorlach - 18 Aug 2003 13:47 GMT
Hello!

I create simple validator add-in for mail merge and meet the following
problem. For example, I have 200 recipients in my data source, and 100
from them are included to mail merge (in other words, 100 addresses
are checked in "Mail Merge Recipients" window, and 100 addresses are
unchecked).

When I click "Validate" in "Mail Merge Recipients" window, my
validator load *ALL* addresses (both checked and unchecked).

1. When the address is checked, my validator can exclude it from
merge; it can also include it back (I can swicth .Included property as
many times as I wish within MailMergeDataSourceValidate -- and all
work as expected).

2. But when I try to include unchecked address to mail merge, nothing
happen! I modify .Included property and the result of operation is
S_OK; value of this property is also changing! But when my validator
return control to MS Word, "Mail Merge Recipients" show this address
as unchecked. And it really still unchecked.

Is this behaviour is normal or it is a bug? Any suggestions? My
verifier should verify only included addresses? I work with Word 2002
10.4219.4219 SP-2.

Thanks,
Alexander Gorlach
Gorlach - 25 Aug 2003 10:02 GMT
Hello again!

I found, that my problem is related to Word object model limitations.
I create another windowless simple "validator" add-in, it include all
contacts to mail merge -- and it work well.

My validator add-in create the window like "Mail Merge Recipients".
Window procedure of my window placed in the same thread as procedure
of "Mail Merge Recipients" window; all my calls to Word object model
are within the thread of OnMailMergeValidate call. So, it is not
multi-threading limitation.

Can anyone point me to right direction? Today, I see only one
solution: create my window at another thread and suspend Word thread
until user work with my add-in. But it is not good way, because Word
UI will not be painted while thread is suspended.

Please, help!

> 2. But when I try to include unchecked address to mail merge, nothing
> happen! I modify .Included property and the result of operation is
> S_OK; value of this property is also changing! But when my validator
> return control to MS Word, "Mail Merge Recipients" show this address
> as unchecked. And it really still unchecked.
Gorlach - 25 Aug 2003 13:17 GMT
Hello!

Uff, solved! MSDN (April 2003) sample for ActiveRecord property:

  'Set the active record equal to the first included
  'record in the data source
  .ActiveRecord = 1
  ......
  'Move the record to the next record in the data source
  .ActiveRecord = .ActiveRecord + 1

This sample is not correct. Word 2002 SP2 don't understand record
number in ActiveRecord property. It will work from time to time,
sometime it will generate error 0x800a16dd (or 5833 in VB syntax),
sometime it will return S_OK, but the changes will not saved, as it
was described in my first message.

But all work fine when I list all records from current or
Word::wdFirstDataSourceRecord to required record with
Word::wdNextDataSourceRecord. It is not fast way when I should modify
only one record from 1000, but it work!!!

> 2. But when I try to include unchecked address to mail merge, nothing
> happen! I modify .Included property and the result of operation is
[quoted text clipped - 5 lines]
> verifier should verify only included addresses? I work with Word 2002
> 10.4219.4219 SP-2.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.