i have such code
For Each objItem In St开发者_如何学运维artFolder.Items                    
    MessageBox.Show("to " + objItem.To)
Next
if field to is empty(empty in letter of outlook), there is no exception but the debugger shows
objItem.To Run-time exception thrown : System.MissingMemberException - Public member 'To' on type 'ReportItem' not found.
how can i catch this? because any try to check property objItem.To will generate another exception
Not knowing exactly what you are trying to do: You could test each item's type before attempting to access a property that does not exist for a particular type (in your post the item type in question is ReportItem).e.g.
For Each objItem In StartFolder.Items 
    '' I think you will need to fully qualify ReportItem with the full namespace...   
    if TypeOf obItem is ReportItem           
        MessageBox.Show("to " + objItem.To) 
Next 
Can you do a try...catch to specifically catch the System.MissingMemberException?
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论