Cannot access most of property of MailItem object on Windows Server 2008 64 bit

T

Tony

Hi,

I wrote a Windows Services to access Outlook (version 2010) folder
programmatically and save email in SQL database. The service reads each
email in Outlook Inbox folder and get details of the emails.

The service works fine with .NET Framework 2.0 on Windows Server 2003 with
Outlook 2010 installed.

After I upgraded the service to .NET Framework 4.0 on Windows Server 2008
(64 bit OS) with Outlook 2010 installed, It was no problem to get Subject
property of MailItem object, it crashed when it tried to get SenderName
and SenderEmailAddress property of MailItem object. I can not catch the
exception even try...catch is used.

Can you please shed some light on this issue? Thank you.
Tony


Code:

folder =
mOutlookNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olPublicFoldersAllPublicFolders)

For intCount = folder.Items.Count To 1 Step -1
folder.Items(intCount).Subject
folder.Items(intCount).SenderName (FAILED HERE)
folder.Items(intCount).SenderEmailAddress
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top