Hi
Using an example I have written some code to put the contents of my outlook inbox into a string. How can I put the results into a grid on my form?
I'd like to be able to select which fields go onto the form.
Cheers
Spange
namespace OutlookExamples
{
public partial class Form1 : Form
{
private Outlook.Application oApp;
public Outlook._MailItem[] oMailItems;
public Form1()
{
InitializeComponent();
oApp = new Outlook.Application();
}
private void Form1_Load(object sender, EventArgs e)
{
string strOutput = "";
Outlook.MAPIFolder fldInbox = (Outlook.MAPIFolder)oApp.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
fldInbox.Items.Sort("[SentOn]", false);
foreach (Outlook._MailItem oMailItem in fldInbox.Items.Restrict("[SentOn] >= '01/01/2009'"))
{
strOutput = strOutput + oMailItem.Subject + " - " + oMailItem.SentOn + Environment.NewLine;
}
MessageBox.Show(strOutput);
}
}
}
Using an example I have written some code to put the contents of my outlook inbox into a string. How can I put the results into a grid on my form?
I'd like to be able to select which fields go onto the form.
Cheers
Spange
namespace OutlookExamples
{
public partial class Form1 : Form
{
private Outlook.Application oApp;
public Outlook._MailItem[] oMailItems;
public Form1()
{
InitializeComponent();
oApp = new Outlook.Application();
}
private void Form1_Load(object sender, EventArgs e)
{
string strOutput = "";
Outlook.MAPIFolder fldInbox = (Outlook.MAPIFolder)oApp.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox);
fldInbox.Items.Sort("[SentOn]", false);
foreach (Outlook._MailItem oMailItem in fldInbox.Items.Restrict("[SentOn] >= '01/01/2009'"))
{
strOutput = strOutput + oMailItem.Subject + " - " + oMailItem.SentOn + Environment.NewLine;
}
MessageBox.Show(strOutput);
}
}
}