Sending Multiple meeting requests to senders in appointment send event
-
יום שישי 17 אוגוסט 2012 09:18
Hi,
I have a requirement where I need to send multiple meeting requests programatically in the appointment send event. Where I need to cancel the original request.
I am not able to send the meeting requests with the below code. Can anyone please clarify why this is happening
private void AppointmentEvent_Send(ref bool Cancel)
{
Inspector inspector = this.Application.ActiveInspector();
_appItem = (Outlook.AppointmentItem)inspector.CurrentItem;
List<string> emailAddresses = new List<string>();
for (int i = 1; i <= _appItem.Recipients.Count; i++)
{
string smtpAddress;
Outlook.ExchangeUser exchangeUser = _appItem.Recipients[i].AddressEntry.GetExchangeUser();
if (exchangeUser != null)
{
smtpAddress = exchangeUser.PrimarySmtpAddress;
}
else
{
smtpAddress = _appItem.Recipients[i].Address;
}
emailAddresses.Add(smtpAddress);
}//for (int i = 0; i < emailAddresses.Count; i++)
//{
// _appItem.Recipients.Remove(1);
//}for (int i = 0; i < emailAddresses.Count; i++)
{
appitem = this.Application.CreateItem(OlItemType.olAppointmentItem); //appitem.Start = _appItem.Start;
appitem.End = _appItem.End;
appitem = _appItem;
appitem.Recipients.Add(emailAddresses[i]);
appitem.Body = i.ToString();
appitem.Send();
/appitem.Recipients.Remove(1);
}Cancel = true;
_appItem.Close(OlInspectorClose.olDiscard);
}
_________________________________________________ Suneel Kumar Vanapalli
כל התגובות
-
יום שישי 17 אוגוסט 2012 11:17
set meetingstatus to olMeeting- סומן כתשובה על-ידי Suneel Kumar Vanapalli יום שישי 17 אוגוסט 2012 17:17
-
יום שישי 17 אוגוסט 2012 17:17Thank you Damian. I missed it
_________________________________________________ Suneel Kumar Vanapalli