![]() |
|
#1
|
|||
|
|||
|
Hi, is there an easy way to find emails in Outlook that have pictures in the text?
|
|
#2
|
||||
|
||||
|
Easy? You can use check whether there is a message attachment with a name like "image*.*" as messages with images will treat those images as attachments. The following function will establish whether the current message has such an image:
Code:
Sub ProcessMessage()
'An Outlook macro by Graham Mayor
Dim olMsg As MailItem
On Error Resume Next
Set olMsg = ActiveExplorer.Selection.Item(1)
MsgBox HasPicture(olMsg)
lbl_Exit:
Exit Sub
End Sub
Private Function HasPicture(olItem As MailItem) As Boolean
'An Outlook macro by Graham Mayor
Dim olAttach As Attachment
Dim strExt As String
Dim j As Long
On Error GoTo lbl_Exit
If olItem.Attachments.Count > 0 Then
For j = olItem.Attachments.Count To 1 Step -1
Set olAttach = olItem.Attachments(j)
If olAttach.FileName Like "image*.*" Then
HasPicture = True
Exit For
End If
Next j
olItem.Save
End If
lbl_Exit:
Set olAttach = Nothing
Set olItem = Nothing
Exit Function
End Function
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Word 2013 - pictures inserted into word appear in two different formats, need to change
|
katm3 | Word | 4 | 05-22-2015 12:53 AM |
copy a page or pages in word with inserted pictures.
|
datakop | Word | 2 | 04-03-2015 06:15 AM |
| Color cast on inserted pictures | xseedman | PowerPoint | 0 | 04-14-2014 06:41 AM |
| How to remove unwanted lines - I cannot even find how/where they are inserted! | nickib | Word | 7 | 08-09-2013 06:01 AM |
| Inserted Pictures Resolution problem | vamus | Word | 5 | 02-26-2013 03:59 PM |