Looping through items

G

Guest

Hi,
I am writing Outlook Add-in project using C#. I want to loop through
calender items from 17-Oct=2006 to 10-Jan-2007. If I found any Meeting
request I want to delete that items. Anybody knows how to do it.

I am looking for the following logic

Outlook._Application olApp = new Outlook.ApplicationClass();
Outlook._NameSpace olNs = olApp.GetNamespace("MAPI");
Outlook.MAPIFolder oContacts =
olNs.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
Outlook.Items oItems = oContacts.Items;

logic as follows
For (datevalue = '17-oct-2006'; datevalue<'10-jan-2007', datevalue++)
{
Calendar.Items.Remove(datevalue); //I am not sure about this logic.
}


thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top