none
Resolve contacts that have no first/last name - "On Error" is not honored RRS feed

  • Question

  • Hi

    The following code works well for resolved contacts that have first & last names But fails if there are no names

    The problem is that "On Error GoTo Resume2" is not honored  (debugger halts & reports RT Error 91)

    Any idea how to handle it ?

    thanks

                    On Error GoTo Resume2
                    Set objItemT = Outlook.Application.CreateItem(olMailItem)
                     
                    With objItemT
                      .To = Email
                    End With
                    
                      If objItemT.Recipients.Item(1).Resolved Then
                        Fname = objItemT.Recipients.Item(1).AddressEntry.GetContact.FirstName '<<== Run Time Error 91
                        Lname = objItemT.Recipients.Item(1).AddressEntry.GetContact.LastName
                      End If
                    'End With
    
                    


    • Edited by BR99 Wednesday, May 16, 2012 11:37 AM
    Tuesday, May 15, 2012 11:44 AM