How to View All Image Attachments of an Outlook Email at the Same Time

At times, you may need to view all the image attachments of an email at the same time. This article will show you a piece of VBA code, which will quickly show and shrink all the image attachments of an email in the first page of a Word document.

By default, to view all image attachments in one Outlook email, you can only open the image attachments one by one to check them separately. However, if you want to compare the images in detail or you just want to view all at once, you have to search other means. Hence, here we’ll share you a piece of VBA code, which can allow you to see all images attachments at the same time.

View All Image Attachments of an Outlook Email at the Same Time

View All Image Attachments of an Email at the Same Time

  1. In the first place, start your Outlook application.
  2. Then, after entering the Outlook main window, you can press “Alt + F11” key buttons.
  3. At once, you will access Outlook VBA editor window, in which you could open an empty module or straightly insert a new module.
  4. Subsequently, copy the following VBA code into such module window.
Sub ViewAllImageAttachmentsinSamePage()
    Dim objMail As Outlook.MailItem
    Dim objAttachment As Outlook.Attachment
    Dim objFileSystem As Object
    Dim strTempFolder As String
    Dim strImage As String
    Dim objWordApp As Word.Application
    Dim objWordDocument As Word.Document
    Dim objWordImage As Word.InlineShape
 
    'Get the source email
    Select Case Application.ActiveWindow.Class
           Case olExplorer
                Set objMail = ActiveExplorer.Selection.Item(1)
           Case olInspector
                Set objMail = ActiveInspector.CurrentItem
    End Select
 
    'Create a new Word document
    Set objWordApp = CreateObject("Word.Application")
    Set objWordDocument = objWordApp.Documents.Add
    objWordDocument.Activate
    objWordApp.Visible = True
 
    'Get the temp folder
    Set objFileSystem = CreateObject("Scripting.FileSystemObject")
    strTempFolder = objFileSystem.GetSpecialFolder(2).Path
 
    'Insert the images into the Word document
    For Each objAttachment In objMail.Attachments
        Select Case LCase(objFileSystem.GetExtensionName(objAttachment.filename))
               Case "jpg", "jpeg", "png", "bmp", "gif"
                    strImage = strTempFolder & "\" & objAttachment.filename
                    objAttachment.SaveAsFile strImage
 
                    Set objWordImage = objWordApp.Selection.InlineShapes.AddPicture(filename:=strImage, LinkToFile:=False, SaveWithDocument:=True)
 
                    'Shrink the image until you see them in the same page
                    objWordImage.ScaleHeight =10
                    objWordImage.ScaleWidth = 10
                    'Insert the path to the image as hyperlink
                    objWordDocument.Hyperlinks.Add objWordImage, strImage
              End Select
    Next
End Sub

VBA Code - View All Image Attachments of an Outlook Email at the Same Time

  1. Next, you can add the new macro to Quick Access Toolbar for handy access.
  2. After that, you can try the new VBA project.
  • Firstly, select or open a source email which contains image attachments to be compared.
  • Next hit the macro button in Quick Access Toolbar, like the screenshot below:Select Mail & Run Macro
  • after macro completes, a new Word document will open up, in which all the image attachments are shown as the picture below:All Images Shown in a Word Document
  • By this way, you can see all image attachments at the same time.

Retrieve PST Data in Case of Outlook Crashes

As we all know, Outlook PST file is prone to corruption. Thus, if Outlook crashes suddenly, your PST data can become corrupted. Therefore, you need to beware of any potential risks around your Outlook. If unfortunately, you meet Outlook crash. You can firstly utilize Scanpst to take a shot. If it fails, a reliable external tool is your last resort, such as DataNumen Outlook Repair. It is highly suggested due to its efficiency and recognized high Outlook recovery rate.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including corrupt sql and outlook repair software products. For more information visit www.datanumen.com

Comments are closed.