#  Other Applications & Softwares  > Outlook Formatting & Functions >  > [SOLVED] How to programatically test if a set object from createitemfromtemplate exists?

## brucemc777

Let's take 


```
Please Login or Register  to view this content.
```


where OutApp is the Outlook object using late binding.

Now how do I test OutMail to see if it has what I intended, or, at very least, something?

If I try 

If OutMail = Nothing 

I get "Invalid Use of Object"

with

If OutMail = "" 
I get "Object doesn't support this property or method."

and

Isempty(OutMail) evaluates to "false" whether or not the target file existed.

The only way I have found is to first run an On Error Resume Next, then immediately after the Set statement testing if err.number is <> 0.

Is there a "better" way?

Is there a property that can be tested in case the target file has been deleted/renamed/abducted by aliens?

Thanks again, very much!

----------


## TMS

```
Please Login or Register  to view this content.
```

----------


## TMS

Thanks for the rep.   :Smilie:

----------


## brucemc777

Thanks for the help!  :Smilie: 

And of course, Red Dwarf...

----------

