View Single Post
  #4  
Old February 27th 08, 03:35 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default access mail from public folder

You certainly should be able to access items that way, assuming you have
sufficient permissions on that folder.

About the only thing I can think of would be to simplify the loop and step
it to see what's going on:

Outlook.Items items = addinboxFolder.Items;
int count = items.Count;
for (int i = 1; i = count; i++)
{
object item = items[i];
if (item.Class == Outlook.OlObjectClass.olMail)
{
Outlook.MailItem mail = (Outlook.MailItem)item;
MessageBox.Show(mail.Subject);
}
}

See what you come up with.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"mithilesh" wrote in message
...
In the loop addinboxFolder retains its scope. Coz, In the loop
addinboxFolder.Display() is open Public Folder.

NO, I am not getting any exception. While declared mi.Subject, execute the
statement before mi.subject but after mi.subject statement is not
executing.
If mi.subject is comment then execute all statement.

While selecting folder Inbox inside of Public then same code execute
proper
without any trouble.

Can I access Public folder mail by this way?


Ads