Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-17-2015, 02:47 AM
Buhaj47 Buhaj47 is offline Find emails with inserted pictures Windows 7 32bit Find emails with inserted pictures Office 2010 32bit
Novice
Find emails with inserted pictures
 
Join Date: Nov 2015
Posts: 3
Buhaj47 is on a distinguished road
Default Find emails with inserted pictures


Hi, is there an easy way to find emails in Outlook that have pictures in the text?
Reply With Quote
  #2  
Old 11-17-2015, 05:43 AM
gmayor's Avatar
gmayor gmayor is offline Find emails with inserted pictures Windows 7 64bit Find emails with inserted pictures Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,105
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
You can call it from a macro to check individual messages (as above) or loop through a selection or folder full of messages
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find emails with inserted pictures Word 2013 - pictures inserted into word appear in two different formats, need to change katm3 Word 4 05-22-2015 12:53 AM
Find emails with inserted pictures 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

Other Forums: Access Forums

All times are GMT -7. The time now is 04:10 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft