![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Hello,
I'm trying to get all the subject lines from a specific folder. Sometimes I get the error 13 saying type mismatch for the following line: Set oCurrentEmail = oFolderEMail.Items.Item(i) I think its because either it came across a read receipt or an email item that it could not recognize. How can I skip that item and move on to the next one. Also, sometimes it does go thru with read recipts but it wont pick up the subject line. Any help would be greatly appreciated. Thanks. |
#2
|
|||
|
|||
![]()
Either handle the error if it occurs and then move on, or test for the Class
or MessageClass of the item before assigning it to a MailItem type object. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "RS" wrote in message ... Hello, I'm trying to get all the subject lines from a specific folder. Sometimes I get the error 13 saying type mismatch for the following line: Set oCurrentEmail = oFolderEMail.Items.Item(i) I think its because either it came across a read receipt or an email item that it could not recognize. How can I skip that item and move on to the next one. Also, sometimes it does go thru with read recipts but it wont pick up the subject line. Any help would be greatly appreciated. Thanks. |
#3
|
|||
|
|||
![]()
I tried to handle the message by saying
ErrorHandler: If Err.Number 0 Then i = i + 1 Resume Next End If It goes to the next message but it duplicated the subject line from previous message eventhough I'm using oCurrentEmail.Subject to get the subject line. What type of message class would be an email item. I did go thru help and I think it would be olMail but then read receipt would probably come under the same class. Thanks. "Ken Slovak - [MVP - Outlook]" wrote: Either handle the error if it occurs and then move on, or test for the Class or MessageClass of the item before assigning it to a MailItem type object. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "RS" wrote in message ... Hello, I'm trying to get all the subject lines from a specific folder. Sometimes I get the error 13 saying type mismatch for the following line: Set oCurrentEmail = oFolderEMail.Items.Item(i) I think its because either it came across a read receipt or an email item that it could not recognize. How can I skip that item and move on to the next one. Also, sometimes it does go thru with read recipts but it wont pick up the subject line. Any help would be greatly appreciated. Thanks. |
#4
|
|||
|
|||
![]()
If you are looping always clear your variables in each pass so they don't
have data from a previous item if there's a failure of some kind. That's a general rule, not specific to this case only. Class == olMail is what you want. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "RS" wrote in message ... I tried to handle the message by saying ErrorHandler: If Err.Number 0 Then i = i + 1 Resume Next End If It goes to the next message but it duplicated the subject line from previous message eventhough I'm using oCurrentEmail.Subject to get the subject line. What type of message class would be an email item. I did go thru help and I think it would be olMail but then read receipt would probably come under the same class. Thanks. |
#5
|
|||
|
|||
![]()
I tried it and it didnt work....any other suggestions.
"Ken Slovak - [MVP - Outlook]" wrote: If you are looping always clear your variables in each pass so they don't have data from a previous item if there's a failure of some kind. That's a general rule, not specific to this case only. Class == olMail is what you want. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "RS" wrote in message ... I tried to handle the message by saying ErrorHandler: If Err.Number 0 Then i = i + 1 Resume Next End If It goes to the next message but it duplicated the subject line from previous message eventhough I'm using oCurrentEmail.Subject to get the subject line. What type of message class would be an email item. I did go thru help and I think it would be olMail but then read receipt would probably come under the same class. Thanks. |
#6
|
|||
|
|||
![]()
What did not work? What is your code?
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "RS" wrote in message ... I tried it and it didnt work....any other suggestions. "Ken Slovak - [MVP - Outlook]" wrote: If you are looping always clear your variables in each pass so they don't have data from a previous item if there's a failure of some kind. That's a general rule, not specific to this case only. Class == olMail is what you want. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "RS" wrote in message ... I tried to handle the message by saying ErrorHandler: If Err.Number 0 Then i = i + 1 Resume Next End If It goes to the next message but it duplicated the subject line from previous message eventhough I'm using oCurrentEmail.Subject to get the subject line. What type of message class would be an email item. I did go thru help and I think it would be olMail but then read receipt would probably come under the same class. Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Please help on this VBA macro. Error 13, type mismatch | John Z | Outlook and VBA | 3 | August 15th 07 09:36 PM |
Runtime Error 13 - Type Mismatch | [email protected] | Outlook and VBA | 1 | May 29th 07 11:28 PM |
Strange behaviour with Type Error | Tobias Schröer | Outlook and VBA | 0 | January 31st 07 09:48 AM |
Script Error - Type mismatch: 'Mycontrols' Line No. 415 | sclark | Outlook - Using Forms | 2 | April 13th 06 08:00 PM |
Why do I get a type mismatch when trying to access mail items? | Pete Dawson (Leeds Uni) | Outlook and VBA | 3 | March 3rd 06 01:16 PM |