Geeks With Blogs
Tim Huffam Dotting the I and crossing the T of I.T.

The following demostrates how to retreive data from items within an Outlook folder (called "MySubFolderName" under the Inbox folder) using .NET:

First add a reference to the Outlook COM object your project:

  1. In VS.NET right click on References and choose Add Reference.
  2. Select the COM tab
  3. Choose "Microsoft Outlook 11.0 Object Library" (this is for MS Office 2003 - I think 10.0 is for Office XP) and click Select.
  4. Click OK.

Note that you can access any Outlook/Exchange object types, eg Appointments, Notes, Tasks, Emails etc - just use intellisense to select which one (eg Microsoft.Office.Interop.Outlook. ... - see definition of variable called 'item' below).

Here's the code:

Microsoft.Office.Interop.Outlook.Application app = null;
Microsoft.Office.Interop.Outlook._NameSpace ns = null;
Microsoft.Office.Interop.Outlook.PostItem item = null;
Microsoft.Office.Interop.Outlook.MAPIFolder inboxFolder = null;
Microsoft.Office.Interop.Outlook.MAPIFolder subFolder = null;

try
{
  app = new Microsoft.Office.Interop.Outlook.Application();
  ns = app.GetNamespace("MAPI");
  ns.Logon(null,null,false, false);

  inboxFolder = ns.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);
  subFolder = inboxFolder.Folders["MySubFolderName"]; //folder.Folders[1]; also works
  Console.WriteLine("Folder Name: {0}, EntryId: {1}", subFolder.Name, subFolder.EntryID);
  Console.WriteLine("Num Items: {0}", subFolder.Items.Count.ToString());

  for(int i=1;i<=subFolder.Items.Count;i++)
  {
    item = (Microsoft.Office.Interop.Outlook.PostItem)subFolder.Items[i];
    Console.WriteLine("Item: {0}", i.ToString());
    Console.WriteLine("Subject: {0}", item.Subject);
    Console.WriteLine("Sent: {0} {1}" item.SentOn.ToLongDateString(), item.SentOn.ToLongTimeString());
    Console.WriteLine("Categories: {0}", item.Categories);
    Console.WriteLine("Body: {0}", item.Body);
    Console.WriteLine("HTMLBody: {0}", item.HTMLBody);
  }
}
catch (System.Runtime.InteropServices.COMException ex)
{
  Console.WriteLine(ex.ToString());
}
finally
{
  ns = null;
  app = null;
  inboxFolder = null;
}

HTH

Tim

Posted on Friday, May 26, 2006 10:35 AM | Back to top


Comments on this post: Accessing Outlook items from C# .NET

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
I was looking for exactly this. The only thing I had to change was casting to a MailItem instead of a PostItem in the for loop cuz I was getting an error. Works great.... TY
Left by alcsharp on May 26, 2006 4:00 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
item = (Microsoft.Office.Interop.Outlook.PostItem)subFolder.Items[i];
its giving ...
Unhandled Exception: System.InvalidCastException: Specified cast is not valid.
Left by Abdul Kader Jilani on May 27, 2006 8:40 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Thanks its working now.
Left by Abdul Kader Jilani on May 27, 2006 8:43 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
its not working in other PC
Left by Abdul Kader Jilani on May 27, 2006 10:19 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
its deployment version is not working in other PC
Left by Abdul Kader Jilani on May 27, 2006 10:20 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
can you help how to &quot;Mark an Email as Read&quot;?
That will help me a lot.
I will be very thankful to you on reply.
Left by Naveen on Sep 07, 2007 6:01 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
I've got a list of 502 items. I can get the first (newest) 240 items. The I cant get them because the items are not postitems or mailitems (or any other item, checked them all) I suspect that there was a migration from exchange 2000 to 2003 arround the date of itemnumber 241. Doe this ring a bell??

Thanks,

Bas
Left by Sebas on Oct 10, 2007 9:47 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
I have got 4 attachments it's extensions are .xsn & .lgo. i am able to extract attachments with extension'e .lgo through Microsoft.Office.Interop.Outlook.PostItem. but i can't extract .xsn files. it's giving me error like unable to convert system._comobject. is there any other way to type cast the items? please help me.
Left by Jayanth on Oct 12, 2007 4:44 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
when i use this (Outlook.PostItem) _item; i am getting error "Specified cast is not valid. "
Left by satish on Nov 26, 2007 1:14 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
hi,

i want to disable "automatic download" feature of MS Outlook 2007 in "trust center" thrugh C#.net.
pls tell me the solution.
Left by abhishek on Dec 17, 2007 12:38 PM

# rdisable "automatic download" in C# .NET
Requesting Gravatar...
hi,

i want to disable "automatic download" feature of MS Outlook 2007 in "trust center" thrugh C#.net.

pls tell me the solution.


Thanks in Advance..

Saurabh..
Left by saurabh on Dec 17, 2007 1:30 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
hi,


i want to access the SEND button in compose. using c# how can we display a message when send button clicked?

pls tell me the solution


thnks n regards,
Srinivas
Left by srinivas on Jan 09, 2008 4:22 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
How to run this code in a deployment scenario? coz as far as i can guess, this runs in the context of the logged in user,so if we are deploying ths code to a server, surely it will fail.
So how to access the mailbox of a user in this scenario?

Left by chris on Jan 10, 2008 11:24 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
How can we specify which user's mailbox to log on to?
Left by adam on Feb 20, 2008 11:34 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Hi,
I just want to say how utterly fantastic I found this page. This is just what I was looking for also. Perfect!

It will allow me to do custom scaping of my outlook files for certain text and make email lists!!

Cheers to you!

Best - Sean
Left by Sean on Feb 22, 2008 12:17 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Hi,

After the 240 Mail items i can't access the mail items.

Could u help me.....

Thanks.
Left by Johnson on Apr 16, 2008 6:06 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Hi ;

My task is to read alll the emails from the outlook component . Here is te code I am using and getting the error :" Specified cast not valid"

Dim _objItem As Outlook.MailItem = Nothing
Dim _objInboxFolder As Outlook.MAPIFolder = Nothing
Dim _objSubfolder As Outlook.MAPIFolder
Dim _outlook As Outlook.MailItemClass
Dim _outlookObj As New Outlook.Application
Dim _outlookNamespace As Outlook.NameSpace
_outlookNamespace = _outlookObj.GetNamespace("MAPI")
_outlookNamespace.Logon(Nothing, Nothing, False, False)
_objInboxFolder = _outlookNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
_objSubfolder = _objInboxFolder.Folders(1)
Response.Write("Folder Name: " & _objSubfolder.Name & " Entry ID" & _objSubfolder.EntryID)
Response.Write("Num Items: " & _objSubfolder.Items.Count)
Dim _itemCount As Integer = _objSubfolder.Items.Count
While (_itemCount <> 0)
_objItem = CType(_objSubfolder.Items(_itemCount), Outlook.PostItem)
Response.Write("Item " & _objItem.Subject.ToString)
_itemCount -= 1
End While



Kindly let me know where I am wrong
Thanks
Left by Harry_cherry on May 26, 2008 8:12 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Thanks!

MailItem vs PostItem - a gold nugget. I still seek a method for determining the kind of item in a folder's Items collection so that I can cast it (or skip it). Seeks hokey to use nested "if (myItems[i] is Microsoft.Office.Interop.Outlook.<item kind>)

Anyway, thanks again!
Left by Scott Welker on Jun 21, 2008 5:46 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Johnson, you aren't releasing your COM objects so the server/client hits it's message limit of 250 items. I struggled with the same issue.

Scott, you can use Reflection to get the MessageClass of the object.
Left by Robbert on Aug 28, 2008 9:34 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Hi,

Thank you for the code.
But I did not find how to connect to the non default Exchange server?
Left by Sergey Vasiliev on Sep 01, 2008 8:34 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
hi,

I cannt found the namaspace Microsoft.Office.Interop.Outlook and i am using vs 2003 and pls guide me
Left by narasiman on Sep 04, 2008 9:20 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
I have the following code :


if (item is Outlook.MailItem)
{
Outlook.MailItem mailItem = item as Outlook.MailItem;
ProcessMailItem(mailItem);
}
else if (item is Outlook.PostItem)
{
Outlook.PostItem postItem = item as Outlook.PostItem;
ProcessPostItem(postItem);
}
else if (item is Outlook.MeetingItem)
{
Outlook.MeetingItem meetingItem = item as Outlook.MeetingItem;
meetingItem.UnRead = false;
}
else
{
Log("unknown item type - " + item.ToString() + " in folder:" + folder.FullFolderPath, MSPLLogMessage.Severity.critical);
}


What we actually have is an Excel object - by dragging an Excel sheet into the Outlook public folder, but our server does not have Office installed, only Outlook. So the else clause only says we have a System.__ComObject. So it doesnt know what an Excel object is. Is there any way we can mark the Excel file as read?
Left by Peter Smith on Sep 19, 2008 12:30 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Nice work,thanks.
Left by Peter Izuoba on Oct 02, 2008 10:14 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Awesome dude.Thanks
Left by Hemnath S on Oct 15, 2008 6:15 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
I just want to give an update on the "Unable to cast COM object of type..." error I am getting and was asking previously. This error that I was getting was caused by conflicts on items in the outlook folder that I was processing. The thing is, when you do a visual check on the items on the folder, there is no way to tell that an item was on conflict until you open it or double click on it. You have to pinpoint the actual item, open it and resolve the conflict before that item becomes a normal item again. Hope this helps cause this issue caused me real grief!
Left by Rick on Oct 17, 2008 3:22 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
This code just sits there in the browser and doesn't retrieve anything.

It opens an Outlook object on the web server and the CPU is running at 75%, so it's doing something!

Any ideas what might be happening?
Left by Phil on Nov 01, 2008 12:22 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
How can i open an attachment w/o saving it
Left by Ritesh on Dec 18, 2008 1:44 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Thanks a lot man !
Left by Nic on Feb 26, 2009 2:03 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
HO CAN I specify the e-mail addres I am retriveing. I have a working cod but it is retreiving only my e-mails. How can I choose a different e-mail?


Microsoft.Office.Interop.Outlook.Application oOutlook;
Microsoft.Office.Interop.Outlook._NameSpace oNs;
Microsoft.Office.Interop.Outlook.MAPIFolder oFldr;
Microsoft.Office.Interop.Outlook.MAPIFolder subFolder = null;
long iAttachCnt;
int CurrentLocationTop = 0;
int CurrentLocationLeft = 0;

public Form1()
{
InitializeComponent();
ReadMailAndSaveAttachemnt();
}
private void ReadMailAndSaveAttachemnt()
{


try
{
oOutlook = new Microsoft.Office.Interop.Outlook.Application();
oNs = oOutlook.GetNamespace("MAPI");
Left by Karyani on Mar 26, 2009 6:57 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
How to check for valid mail while reading a particular mail in using C#.

I am getting error for Casting
Left by Sanjay on Mar 27, 2009 3:30 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
How to check for valid mail while reading a particular mail in using C#.

I am getting error for Casting please tell me how can i cast the mail item
Left by Sanjay on Mar 27, 2009 3:31 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
I have one addidtional mailbox "Callworks@agilent.com" in addition to my primary mailbox "sudhakar.verma@non.agilent.com".
PROBLEM --> when i sent an email from primary mailbox to callworks then c# window service using mapi access it and marked as read.its working fine here.
But if someone else send email to callworks then window service also access it but unable to mark as read. I don't know why....Please help !!!
Left by Sudhakar Verma on Mar 27, 2009 9:37 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
i tried the above code but i have the problem of invalid cast
and get the following exception any help plz the error is
Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook.PostItem'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063024-0000-0000-C000-000000000046}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

any help ASAP
Left by mohamed abdeen on Apr 30, 2009 6:12 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Hi,

Can i access the Outlook items in the exchange server from my application.?
Left by res on May 04, 2009 10:45 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Your example saved me much time.
Thanks.
Left by marc on Jul 16, 2009 12:01 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Its catching "Array out of Bound" exception if the email has no attachment. how to rectify this.?
Left by leo on Aug 06, 2009 1:36 PM

# Read Outlook 2007 categories using C# .NET
Requesting Gravatar...
Hi
I am using .net framework 3.5 by using C# to configure outlook 2007
I need to import all categories from outlook 2007 to my application particularly on dropdownlist, i want to listed all the categories
from outlook to one combobox in my application, i don't know how to get all the categories,

pls reply me.

Left by Hemalatha on Sep 03, 2009 4:34 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
could you please let me know how we can loop though emails in outlook's .PST files saved on hard disk?
Left by Ramesh on Sep 29, 2009 4:27 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Great article :)

Iused the same code in a windows service...I am trying to fetch the latest mail. But it is Access violation error is comming can you help
Left by Ravichandra Chinta on Nov 24, 2009 8:06 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Hi!
I`m locked in "limit of 250 items" while reading Tasks folder.
How can i release opened items and continue searchin?
Thanks...
Left by Slav on Jan 21, 2010 3:07 AM

# re: Read Outlook 2007 categories using C# .NET
Requesting Gravatar...
Outlook.Application olApp = new Outlook.Application();
Outlook.NameSpace ns = olApp.GetNamespace("MAPI");
Outlook.Categories cat = ns.Categories;

foreach (Outlook.Category indCat in cat)
{

label1.Text += indCat.Name.ToString();

}
Left by Mehnaz Awar on Feb 18, 2010 1:57 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
The code listed so far will not work if put inside a windows service. I'm getting errors when I put the code from my console app into a windows service:

Dim objApp As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application

' Get Mapi namespace
Dim objNs As Microsoft.Office.Interop.Outlook.NameSpace = objApp.GetNamespace("MAPI")


Any ideas?
Left by Zubair on Jun 21, 2010 4:29 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Please Help me out ..
i tried ur code but it generating error

Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook.PostItem'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063024-0000-0000-C000-000000000046}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

how can throw this error ...
Left by Tanveer Alam on Jun 28, 2010 5:39 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
I am also facing the same issue
Left by Anand on Jul 08, 2010 4:27 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Use Microsoft.Office.Interop.Outlook.MailItem instead of PostITem ... that should fix the "No such interface supported" exception.
Left by pri on Sep 01, 2010 4:34 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
thank you for giving me my first outlook interop code, and it works, after changing PostItem to MailItem.

Left by Med on Oct 08, 2010 5:12 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Any can can help me. how can i use the above code to retrieve the items of my calender and how can i get the entries and display

Many Thanks,
Husnain
Left by Husnain Naz on Oct 29, 2010 8:29 AM

# re: How ro get subject - Anyone please help me..............
Requesting Gravatar...
Hi, I am trying to set the value of 'SentOn' value of a mail item using MAPI extensions, but it always throw error. Following is the code what I am using...
mailItem.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/proptag/0x00390040", DateTime.now)

Please help me, this is killing me...
Left by Suresh on Nov 23, 2010 4:26 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
When i use this code in windows service it through exceptions
Left by Subhan on Nov 26, 2010 8:20 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
'subFolder.InAppFolderSyncObject' threw an exception of type 'System.Runtime.InteropServices.COMException this exception occurs
Left by A.Manojkumar on Feb 12, 2011 2:41 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
giving error on
item = (Microsoft.Office.Interop.Outlook.PostItem)subFolder.Items[i];

Invalid cast.
Please please help!!!
Left by reshma on Feb 24, 2011 7:37 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
error on item = (Microsoft.Office.Interop.Outlook.PostItem)subFolder.Items[i];

Invalid cast.
Please please help!!!
Left by reshma on Feb 24, 2011 7:38 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
it is reading without any sorted order. How can we read it in sorted order by date.
Left by govardhan on Mar 01, 2011 6:06 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Good Article.Thanks a lot.
Left by Vivek on Mar 09, 2011 4:03 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Just change to (Microsoft.Office.Interop.Outlook.MailItem).
Left by Thiago on Mar 28, 2011 10:31 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
How I can read specific message and save its attachement
Left by Shrikant on Apr 19, 2011 5:53 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
@govardhan: To sort by date, use the Sort() function on the Items collection, with the sort property being "SentOn". For an example:

Microsoft.Office.Interop.Outlook.Items theItems = subFolder.Items.Sort("SentOn",true); //true for descending, false for ascending


for(int i=1;i<=theItems.Count;i++)
{
item = (Microsoft.Office.Interop.Outlook.MailItem)theItems[i];
Console.WriteLine("Item: {0}", i.ToString());
Console.WriteLine("Subject: {0}", item.Subject);
Console.WriteLine("Sent: {0} {1}" item.SentOn.ToLongDateString(), item.SentOn.ToLongTimeString());
Console.WriteLine("Categories: {0}", item.Categories);
Console.WriteLine("Body: {0}", item.Body);
Console.WriteLine("HTMLBody: {0}", item.HTMLBody);
}

Left by terry on May 12, 2011 11:01 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Oops, my bad. Should be this:

Microsoft.Office.Interop.Outlook.Items theItems = subFolder.Items;
theItems.Sort("SentOn",true); //true for descending, false for ascending
Left by terry on May 12, 2011 11:02 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Hi, I have integrated my component with Outlook in C# VisualStdio2008. My scenario is, im tranferring 10 contacts to outlook 'contacts' folder and i want to attach a file to all 10contacts . Im bringing the last transferred [10th] contact to forefront, and attachment is enabled only to the 10th, NOT TO THE PREVIOUS 9CONTACTS. Can anyone help ?....
Left by Harish on Jun 06, 2011 12:54 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
How can i specify different mail address in this exapmle ?
Left by SwAt on Jul 25, 2011 1:14 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Hi, this code works fine. But every time i run this code , outlook ask to allow this to access to read email. how to handle this in coding side.? pl help me. this is urgent.
Left by P.Umamaheswari on Sep 23, 2011 11:51 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
When I try this, I get a message that ASP.NET does not have permission to access this file. What file? Not sure what file to use and how to give it permission to access it.
Left by Paul R on Sep 28, 2011 4:14 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
the code seems to work find on my machine. everytime i deploy the solution to the server it failed.

I get the following error:
Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Outlook.PostItem'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063024-0000-0000-C000-000000000046}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

any help ASAP
Left by Ike on Dec 01, 2011 2:18 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Regarding the _ComObject error, I ran into as well... not sure objects are being returned when accessing by the ordinal number.. maybe a calendar item, or an appointment.. but who cares.. I was interested in only inbox messages.
So, I used the very straightforward and simple logic
for (int i =1; i <=inBoxFolder.Items.Count;i++)
{
try
{
item = (MailItem)inBoxFolder.Items[i];
Console.WriteLine(item.ToString());
Console.WriteLine(item.Subject.ToString());
}
catch { }

}
Left by Sankar on Dec 02, 2011 11:44 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Re the comment that Terry included on 5/12/11 on how to sort items by date, I have been unable to make it work. It simply does not make any difference. It does get other info I requested like total count of items and so on.

Piece of code is as follows:
inboxFolder = ns.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);
inboxFolder.Items.Sort("[SentOn]", false);


Whether the Items.Sort method is included or not, it always reads the same message, and it makes no sense what order is currently in use.

Note: The items are in the main Inbox folder location, so no subfolder command is being used.

Any suggestions? Thanks
Left by Ricardo Martin on Jan 30, 2012 9:25 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Opening Outlook mail item code is working fine on my Local computer but its not working when i deploy it on server.I have already installed Microsoft Office and O2003PIA.EXE on server. Its not even throwing any error.

Any Suggestions ASAP. Thanks.
Left by sparikh on Mar 08, 2012 11:06 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
if i want to connect outlook out of office assistant with my own created calender,how should i proceed??
Left by ankit on May 21, 2012 7:50 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
Hi... i tried to use ur code for my outlook integration with Windows Form in C#... and i got following error...

System.Runtime.InteropServices.COMException (0x8004010F): The operation failed. An object could not be found.
at Microsoft.Office.Interop.Outlook.FoldersClass.get_Item(Object Index)
at WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\shamala\My Documents\Visual Studio 2008\Projects\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:line 50
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in WindowsFormsApplication1.exe
The thread 0x1644 has exited with code 0 (0x0).
The thread 0x1948 has exited with code 0 (0x0).
The program '[7720] WindowsFormsApplication1.vshost.exe: Managed' has exited with code 0 (0x0).

Please Help me out...
Left by Ashish on Jun 29, 2012 5:36 AM

# Track who deleted of Mail from Shared mail box from out look: Accessing Outlook items from C# .NET
Requesting Gravatar...
Hi Guys,

I came into situation something like this as mentioned below and need to program accordingly.

There is one shared Inbox, on which different people work together.

So how can I track the username of the user who deleted or moved email from shared mail.

Can you please provide some link or idea?
Left by Vineet Seheju on Jul 27, 2012 2:35 PM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
hi,

I want to change the message body at runtime, I have created few email message template and a outlook ribbon for the email compose window. I want that when I select any template from the ribbon the message body inside the template should be populated on the open email message body, My problem is that I don't know how can I access the compose message body which is already open, I can make a new email message at run time but this time I want to access the message body which is already open and replace the message body text with the template message text.

Please provide any link or idea, help needed...

Rohit
Left by Rohit on Dec 21, 2012 6:13 AM

# re: Accessing Outlook items from C# .NET
Requesting Gravatar...
I need to access or get the network id from outlook can u pls help me?
Left by Subburam on Jan 08, 2013 1:29 AM

Your comment:
 (will show your gravatar)


Copyright © Tim Huffam | Powered by: GeeksWithBlogs.net | Join free