This would be the correct syntax:
On Error Resume Next
' code to return some obj as an object variable
If Not obj Is Nothing Then
' then you know obj exists
End If
"Ed" <elandau1@gmail.com> wrote in message news:ef4bc400-3dae-4e1d-95d7-540183a7cd68@n19g2000prg.googlegroups.com...
> I'm writing VBA for Outlook 2007. I set an object to point to an
> email Item in an explorer.
>
> If the item is moved or deleted, the object returns an error when I
> try to access it. Is there a way to tell if the object still exists?
> Something like: if (exists Object) then ??
>
> I could just trap on the error but then the code start looking like
> "Basic" with goto statement :).
>
> Thanks,
> -Ed