MDemartino
Member
- Outlook version
- Outlook 2010 32 bit
- Email Account
- Exchange Server
Hi, first of all sorry for my bad english! I'm a new outlook developer, i'm creating a simple addin for outlook 2007 with vs2010 vsto. My customer wants a new menu to open a new meeting appointment. In this new appointment i have to add all conference rooms (about 15) and make them all unsendable.
this is my code:
Outlook.AppointmentItem appt = Application.CreateItem(Outlook.OlItemType.olAppointmentItem) as Outlook.AppointmentItem;
appt.MeetingStatus = Outlook.OlMeetingStatus.olMeeting;
Outlook.AddressEntries lst = Application.GetNamespace("MAPI").GetGlobalAddressList().AddressEntries;
CustomerOlAddIn.Properties.Settings ncv = new CustomerOlAddIn.Properties.Settings();
string NameConvention = ncv.NameConv;
foreach (Outlook.AddressEntry item in lst)
{
if (item.Address.ToLower().IndexOf(NameConvention) >= 0)
{
Outlook.ExchangeUser excusr = item.GetExchangeUser();
Outlook.Recipient confRoom = appt.Recipients.Add(excusr.PrimarySmtpAddress);
confRoom.Type = (int)Outlook.OlMeetingRecipientType.olResource;
//make confRoom unsendable
}
}
appt.Recipients.ResolveAll();
appt.GetInspector.SetCurrentFormPage(ncv.Scheduling);
appt.Display(false);
I'm using Microsoft.Office.Interop.Outlook.dll v12.0 that hasn't .Sendable recipient's property.
Please someone can give me an help to solve my problem??
Thanks
this is my code:
Outlook.AppointmentItem appt = Application.CreateItem(Outlook.OlItemType.olAppointmentItem) as Outlook.AppointmentItem;
appt.MeetingStatus = Outlook.OlMeetingStatus.olMeeting;
Outlook.AddressEntries lst = Application.GetNamespace("MAPI").GetGlobalAddressList().AddressEntries;
CustomerOlAddIn.Properties.Settings ncv = new CustomerOlAddIn.Properties.Settings();
string NameConvention = ncv.NameConv;
foreach (Outlook.AddressEntry item in lst)
{
if (item.Address.ToLower().IndexOf(NameConvention) >= 0)
{
Outlook.ExchangeUser excusr = item.GetExchangeUser();
Outlook.Recipient confRoom = appt.Recipients.Add(excusr.PrimarySmtpAddress);
confRoom.Type = (int)Outlook.OlMeetingRecipientType.olResource;
//make confRoom unsendable
}
}
appt.Recipients.ResolveAll();
appt.GetInspector.SetCurrentFormPage(ncv.Scheduling);
appt.Display(false);
I'm using Microsoft.Office.Interop.Outlook.dll v12.0 that hasn't .Sendable recipient's property.
Please someone can give me an help to solve my problem??
Thanks