# Outlook VBA way to differentiate between attachments and embedded images?



## Tarver (Jun 13, 2019)

I'm trying to prevent myself from accidentally sending a file to someone outside of my organization's domain.  (We've all hit the "reply all" button and sent something to someone we didn't know was in the email chain, right?)   I've got some code I found online, but it doesn't make a determination between a file that's attached to the email and images that are embedded within the email.

So, for instance, because my email signature includes the company logo, every single email I send is stopped by the code

```
If Item.Attachments.Count > 0 Then
```

I could raise this to be >1 to account for my signature, but then any email I send without a signature could include an attachment of sensitive information, and the code wouldn't stop it from going out.

Is there a way to look for ONLY attached files, rather than ALL files that would normally be included in the body of an email?

Thanks!


----------



## Norie (Jun 13, 2019)

Why not loop through the attachments, checking them as you go?

```
For Each att In Item.Attachments
    ' check att
Next att
```


----------



## John_w (Jun 14, 2019)

Tarver said:


> Is there a way to look for ONLY attached files, rather than ALL files that would normally be included in the body of an email?
> 
> Thanks!


Did you see my reply in your original thread on this subject?  

https://www.mrexcel.com/forum/gener...g-outside-domain-post5294426.html#post5294426


----------

