O
othmane benchebab
HI,
there are my code behind , but i have a probleme : can everyone help me please.
string ID="";
Outlook.AppointmentItem nouveauRdv;
nouveauRdv =(Outlook.AppointmentItemoutlookApplication.CreateItem(Outlo ok.OlItemType.olAppointmentItem);
try
{
nouveauRdv.Start = Convert.ToDateTime(_start);
nouveauRdv.End = Convert.ToDateTime(_fin);
nouveauRdv.Body = _corps;
}
catch
{
}
nouveauRdv.Save();
Outlook.NameSpace outlookNameSpace = outlookApplication.GetNamespace("MAPI");
Outlook.MAPIFolder calendarFolder = outlookNameSpace.GetDefaultFolder(Microsoft.Office.Interop.O utlook.OlDefaultFolders.olFolderCalendar);
Outlook.Items appointmentItems;
Outlook.AppointmentItem RdvRecherche;
RdvRecherche = null;
string filter = string.Format("[Start] = '{0}' And [End] = '{1}'", _start,_fin);
appointmentItems = calendarFolder.Items.Restrict(filter);
for (int i = 0; i < appointmentItems.Count; i++)
{
RdvRecherche = (Outlook.AppointmentItem)appointmentItems[i + 1];
}
ID =RdvRecherche.GlobalAppointmentID;
***************************************
I have problem because when i print "appointmentItems.Count" , I find 0.
there are my code behind , but i have a probleme : can everyone help me please.
string ID="";
Outlook.AppointmentItem nouveauRdv;
nouveauRdv =(Outlook.AppointmentItemoutlookApplication.CreateItem(Outlo ok.OlItemType.olAppointmentItem);
try
{
nouveauRdv.Start = Convert.ToDateTime(_start);
nouveauRdv.End = Convert.ToDateTime(_fin);
nouveauRdv.Body = _corps;
}
catch
{
}
nouveauRdv.Save();
Outlook.NameSpace outlookNameSpace = outlookApplication.GetNamespace("MAPI");
Outlook.MAPIFolder calendarFolder = outlookNameSpace.GetDefaultFolder(Microsoft.Office.Interop.O utlook.OlDefaultFolders.olFolderCalendar);
Outlook.Items appointmentItems;
Outlook.AppointmentItem RdvRecherche;
RdvRecherche = null;
string filter = string.Format("[Start] = '{0}' And [End] = '{1}'", _start,_fin);
appointmentItems = calendarFolder.Items.Restrict(filter);
for (int i = 0; i < appointmentItems.Count; i++)
{
RdvRecherche = (Outlook.AppointmentItem)appointmentItems[i + 1];
}
ID =RdvRecherche.GlobalAppointmentID;
***************************************
I have problem because when i print "appointmentItems.Count" , I find 0.