Add recipient to meeting in OnItemSend event

Add-in Express™ Support Service
That's what is more important than anything else

Add recipient to meeting in OnItemSend event
Add recipient to meeting in OnItemSend event 
Victor Ulloa


Guest


Hi,
I'm new to Add-in Express (I buy it today!), so excuse me if my question is too basic.

I'm trying to create an add-in that will manage the ItemSend event and add one recipient to the Recipients of a meeting request.

My code looks like this:

procedure TAddInModule.adxOutlookAppEvents1ItemSend(ASender: TObject;
const Item: IDispatch; var Cancel: WordBool);
var
Meeting : MeetingItem;
Appointment : AppointmentItem;
begin
if Assigned(Item) then
begin
Item.QueryInterface(IID__MeetingItem, Meeting );
if Assigned(Meeting) then
try
ShowMessage('Reunion');
Meeting.Body := Meeting.Body+'[Esta es automatica 20:21]';
Appointment := Meeting.GetAssociatedAppointment(false);
Appointment.RequiredAttendees := Appointment.RequiredAttendees+'; sistema_reuniones2@local.tierrafertil.com';
finally
Meeting := nil;
Appointment := nil;
end;
end;
end;
.

The event is firing (I see the "Reunion" Message). If I open the sent item (from the Sent Items folder) the body of the message and the recipient list are updated.

But it seems that the message is NOT sended to the added recipient. The body, however, is updated when the other recipients get the mail... but there are no traces of the added recipient.

The added recipient does not receive the message. The mail address is correct: if I manually send a mail to this address it's received ok.

I tried both Meeting.Recipients and Meeting.GetAssociatedAppointment(false).Recipients with the same result.

What am I missing?

Thanks!
Posted 17 Jul, 2006 22:46:17 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Victor,

I think you should add the recipient both to the RequiredAttendees property and to the Recipients collection. Also you need to call the ResolveAll method of the Recipients collection.

Posted 18 Jul, 2006 06:18:37 Top
Victor Ulloa


Guest


Thank you, Dmitry!

I already spended some hours trying an alternate way using the BeforeCheckName sample on the Delphi How-to's page, but it's too cumbersome.

Yours it's the right way! Thanks!
Posted 18 Jul, 2006 08:54:07 Top