By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,572 Members | 963 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,572 IT Pros & Developers. It's quick & easy.

Retreiving signed / encrypted messages OL2003

P: n/a
Hi,

I used Outlook 2003 to progammatically read some signed/encrypted messages,
however it semms that the message collections can't return a mailitem object

oMsg = Outlook.Items.GetFirst

and returned an exception message of "Specified cast is not valid."

When I read a non-secure message, it does return a mailitem without exception.

I tried CType(Outlook.Items.GetFirst, Outlook.MailItem) and
DirectCast(Outlook.Items.GetFirst, Outlook.MailItem), but couldn't fix it.

Anybody have an ideal? Thanks

Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Define oMsg as Object NOT as MailItem. It works then.

"Li Pang" wrote:
Hi,

I used Outlook 2003 to progammatically read some signed/encrypted messages,
however it semms that the message collections can't return a mailitem object

oMsg = Outlook.Items.GetFirst

and returned an exception message of "Specified cast is not valid."

When I read a non-secure message, it does return a mailitem without exception.

I tried CType(Outlook.Items.GetFirst, Outlook.MailItem) and
DirectCast(Outlook.Items.GetFirst, Outlook.MailItem), but couldn't fix it.

Anybody have an ideal? Thanks

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.