PC Review


Reply
Thread Tools Rate Thread

vb.net Outlook Interop (Inbox item types) How many are there and how to tell difference?

 
 
Roger
Guest
Posts: n/a
 
      10th Jun 2005
I have a program that goes through an outlook inbox.

Dim myItem as Outlook.MailItem

For i = 1 to items.count
myItem = myolap.items(i)
...
....
....
Next

I get a cast error exception when I get to a "Undeliverable:" in the inbox.
How do I look at the type of item before assigning?

Also what type is an Undeliverable?

Thanks,

Roger





 
Reply With Quote
 
 
 
 
Sue Mosher [MVP-Outlook]
Guest
Posts: n/a
 
      26th Jul 2005
It's a ReportItem. You should never assume that all the items in any Outlook folder are the same item type. You can use TypeOf to determine the type of a generic Object variable, then cast to a specific variable appropriately.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Roger" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
>I have a program that goes through an outlook inbox.
>
> Dim myItem as Outlook.MailItem
>
> For i = 1 to items.count
> myItem = myolap.items(i)
> ...
> ....
> ....
> Next
>
> I get a cast error exception when I get to a "Undeliverable:" in the inbox.
> How do I look at the type of item before assigning?
>
> Also what type is an Undeliverable?
>
> Thanks,
>
> Roger
>
>
>
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TFS 2005: Custom fields in Work Item Type not shared amongst otherWork Item Types? wimdows@gmail.com Microsoft C# .NET 0 8th Feb 2008 02:23 PM
Outlook 2003 Inbox not synchronizing. Difference in Offline and se Erik Microsoft Outlook Installation 0 3rd Dec 2007 03:36 PM
Outlook 2003 Inbox not synchronizing. Difference in Offline and se Erik van Ast Microsoft Outlook Discussion 0 3rd Dec 2007 03:35 PM
vb.net Outlook Interop (Inbox item types) How many are there and how to tell difference? Roger Microsoft VB .NET 1 26th Jul 2005 03:32 PM
Multiple Item 'Types' In A Single Outlook Folder - Possible? Alan Microsoft Outlook Discussion 7 23rd Oct 2003 06:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:50 PM.