C# and Outlook Calendar **SOLVED**
Hey all,
I am trying to get all my appointments stored in my Outlook Calendar. Problem is that it seems like I cant go through my appointments using the next method. Heres my code:
Code:
myApp = new Outlook.Application();
myNamespace= myApp.GetNamespace("MAPI");
myNamespace.Logon(null,null,false,true);
string test = "";
myFolder = myNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar);
Outlook._AppointmentItem myItem;
myItem =(Outlook._AppointmentItem)myFolder.Items.GetFirst();
test = myFolder.Items.Count.ToString();
for (int x =0;x < myFolder.Items.Count;x++)
{
test = test + myItem.Subject.ToString();
myItem =(Outlook._AppointmentItem)myFolder.Items.GetNext();
}
All it does is get the firts entry using
Code:
myItem =(Outlook._AppointmentItem)myFolder.Items.GetFirst();
and the next one using
Code:
myItem =(Outlook._AppointmentItem)myFolder.Items.GetNext();
So I get 92 times one Entry and the first one.
Hope this explanation is not to confusing :confused:
Thanks,
Stephan