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
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