View Single Post
 
Old 04-10-2012, 12:55 PM
tz900 tz900 is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Apr 2012
Posts: 1
tz900 is on a distinguished road
Default Cannot access most of property of MailItem object on Windows Server 2008 64 bit

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.OlDefau ltFolders.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
...
Reply With Quote