Outlook object model

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
 
M

Mike P

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?
 

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