Outlook object model

  • Thread starter Thread starter Mike P
  • Start date Start date
M

Mike P

I am switching some code from using a reference to Outlook 10 to Outlook
11, but it is breaking some code where I was referring to an inbox items
collection and trying to get at an individual item from the inbox -
since it says that 'Microsoft.Office.Interop.Outlook does not contain a
a definition for item'. Can anybody help?

private void MoveMail(Items col, MAPIFolder destfolder, SqlConnection
objConn, int intInvalidItem)
{
string strInsertQuery = "";

for (int i = 1; i < col.Count + 1; i++)
{

if (col.Item(i) is Outlook.MailItem)
{
MailItem oMsg = (MailItem)col.Item(i);

.....etc
 
Switching from

if (col.Item(i) is Outlook.MailItem)

to

if (col is Outlook.MailItem)

doesn't work, because it doesn't recognise anything as an
Outlook.MailItem. Can anybody help me out here?
 
Back
Top