Discussion:
add recipient to message and display it in the To/Cc/Bcc-field of the client
(too old to reply)
Guido Langenbach
2003-10-23 09:39:22 UTC
Permalink
Hallo,

I want to add a recipient to a new message and the users should see the new
recipient in the To-field of the client.

I added a new icon to the toolbar and with the code behind the icon I can
add recipients to the message with SetRecipients(), but they don't appear in
the To-field.
Then I can send the message without problems. All the recipients get the
message.

Is there a method to display the new recipients?

When I hit "check names" the new recipients appear. Is it possible to
trigger the "onchecknames"-event within the script?

Thanks,

Guido Langenbach
Volker Bartheld
2003-10-23 12:14:14 UTC
Permalink
Hi Guido!

On Thu, 23 Oct 2003 11:39:22 +0200, "Guido Langenbach"
Post by Guido Langenbach
I added a new icon to the toolbar and with the code behind the icon I can
add recipients to the message with SetRecipients(), but they don't appear in
the To-field.
Does the new recipient appear when you reload the message in the
inspector by first klicking on another message and then browsing back?
If that's the case, you'll unfortunately have to live with it. At leat
*I* don't have a clue on how to make OL programmatically update its
views.


Volker
Guido Langenbach
2003-10-23 13:25:30 UTC
Permalink
No, the recipient only appears by hitting "checking names" or "select
names".
Post by Volker Bartheld
Does the new recipient appear when you reload the message in the
inspector by first klicking on another message and then browsing back?
Volker Bartheld
2003-10-23 15:31:52 UTC
Permalink
Hi!

On Thu, 23 Oct 2003 15:25:30 +0200, "Guido Langenbach"
Post by Guido Langenbach
No, the recipient only appears by hitting "checking names" or "select
names".
You did a IMessage::SaveChanges(FORCE_SAVE) on your email message,
didn't you?

V.
Guido Langenbach
2003-10-23 15:49:45 UTC
Permalink
No. I tried it and it has no effect.

Guido
Post by Volker Bartheld
You did a IMessage::SaveChanges(FORCE_SAVE) on your email message,
didn't you?
V.
Volker Bartheld
2003-10-23 17:12:05 UTC
Permalink
Hi!
Post by Guido Langenbach
Post by Volker Bartheld
You did a IMessage::SaveChanges(FORCE_SAVE) on your email message,
didn't you?
On Thu, 23 Oct 2003 17:49:45 +0200, "Guido Langenbach"
Post by Guido Langenbach
No. I tried it and it has no effect.
Come to think of it: Is this a *new* message (as in "File/New/Mail
Message") open in an inspector for which you want to add a new
recipient?

If it is, be aware that as long as it has not been saved (you'll have to
use the OOM to achieve that, afaik), there are some properties/functions
missing. So you should either do a _MailItem::Save() prior to getting
_MailItem::MAPIOBJECT and accessing the list of recipients of the
IMessage-Interface you get or if that is not appropriate, use the
Outlook Object Model and execute _MailItem::Recipients::Add() to add a
new recipient to the list.

At least with Dmitry's OL-Spy, the latter worked fine for me. Instantly.
Without having to refresh.

If you plan to add recipients for a message that is already in the
store: That's a different story.


HTH,
Volker
Dmitry Streblechenko
2003-10-23 17:25:00 UTC
Permalink
You are out of luck - Outlook does not see any changes made though Extended
MAPI until you dereference and reopen the message.
As a workaround, you can use Outlook Object Model to set the MailItem.To
property (only reading is blocked).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Post by Guido Langenbach
Hallo,
I want to add a recipient to a new message and the users should see the new
recipient in the To-field of the client.
I added a new icon to the toolbar and with the code behind the icon I can
add recipients to the message with SetRecipients(), but they don't appear in
the To-field.
Then I can send the message without problems. All the recipients get the
message.
Is there a method to display the new recipients?
When I hit "check names" the new recipients appear. Is it possible to
trigger the "onchecknames"-event within the script?
Thanks,
Guido Langenbach
Loading...