PC Review


Reply
Thread Tools Rate Thread

Accessing outlook express

 
 
New Member
Join Date: Apr 2009
Posts: 1
 
      23rd Apr 2009
aftre reading 120 mail frm outlook it shows Error can any 1 tell me the reason??

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Office.Interop.Outlook;

namespace started
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}



private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{

}

private void textBox1_TextChanged(object sender, EventArgs e)
{

}


private void button1_Click(object sender, EventArgs e)
{
// MessageBox.Show("came here1212121");

int i;
int j;
int m = 0;

do
{

Microsoft.Office.Interop.Outlook.Application myApp = new Microsoft.Office.Interop.Outlook.ApplicationClass();
Microsoft.Office.Interop.Outlook.NameSpace mapiNameSpace = myApp.GetNamespace("MAPI");
Microsoft.Office.Interop.Outlook.MAPIFolder myInbox = mapiNameSpace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);
i = myInbox.Items.Count;
j = Int32.Parse(textBox1.Text);
int k = 0;
k=i - j;
string message = "";
message = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[k]).SenderName;
((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[k]).SenderName;
message = message + " " + ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[k]).CreationTime.ToString();
((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[k]).SenderName;
listBox1.Items.Add(message); listBox1.Items.Add(((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[k]).Subject);
message = "";
j = j + 1;
textBox1.Text = j.ToString();
} while ((i - j )> 0);

}

}
}
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Outlook Express Thru' C# =?Utf-8?B?QWRoaXJhag==?= Microsoft C# .NET 2 9th Feb 2005 09:01 PM
Accessing Outlook Express Ray Heath Microsoft Windows 2000 CMD Promt 1 22nd Aug 2004 01:33 AM
Accessing Outlook Express Pam Microsoft Outlook Discussion 0 26th May 2004 04:43 PM
accessing Outlook Express =?Utf-8?B?Q2hyb21YeA==?= Windows XP New Users 4 14th Apr 2004 08:48 PM
Accessing URLs from Outlook Express =?Utf-8?B?cmV0aXJlZDY=?= Windows XP Internet Explorer 1 26th Mar 2004 10:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:06 PM.