TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
peesapati
NA
1
0
Outlook and C# problem :(
Apr 15 2004 9:09 AM
Hi I am woking with Outlook and c#. I have Outlook 2000 installed on my machine. And hence I have Microsoft Outlook 9.0 Object Library (msoutl9.olb). I am using the following code to access each item in the default outbox folder. I am not able to access individual items in the collection. I am getting the following error: F:\PracFold\mydotnet\myc#\prthree\sol_three\prj_three\Form1.cs(142): foreach statement cannot operate on variables of type 'Outlook.Items' because 'Outlook.Items' does not contain a definition for 'GetEnumerator', or it is inaccessible Is the Outlook.Items collection not supported by Outlook 2000 ??? My code is : public void button1_Click(object sender, System.EventArgs e) { try { Outlook.Application oApp = new Outlook.Application(); Outlook._NameSpace oNameSpace = oApp.GetNamespace("MAPI"); oNameSpace.Logon(null,null,false,true); Outlook.MAPIFolder oOutboxFolder = oNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderOutbox); MessageBox.Show("There are " + oOutboxFolder.Items.Count.ToString() + " items in the Outbox.","Mails in Outbox"); Outlook.Items olMailItems = oOutboxFolder.Items; foreach(Outlook.MailItem olMail in olMailItems) { MessageBox(olMail.To.ToString()); } oNameSpace.Logoff(); } catch(Exception ex) { MessageBox.Show(ex.Message,"Prasad, an error occured !!!"); } } Please help me with this. Prasad P
Reply
Answers (
1
)
Connection to oracle database
Setup and Deployment