How to Batch Copy All Embedded Images from One Outlook Email to Another

Multiple users have such a requirement – batch copy all embedded images from an email to a new email in Outlook. Therefore, in this article, we will share a method to easily realize it.

In general, to copy all embedded images from one email to another, you have to copy one by one or batch copy them after selecting one by one. Obviously, those manual means are too troublesome and tedious. Hence, in the followings, we will introduce a far more efficient way to you. Please read on to get its detailed steps and concrete VBA code.

Batch Copy All Embedded Images from One Email to Another

  1. First, launch Outlook VBA editor with reference to “How to Run VBA Code in Your Outlook“.
  2. Then, follow the steps in “How to Add an Object Library Reference in VBA” to enable “MS Word Object Library”.
  3. Next, put the following VBA code into an empty module.
Sub CopyAllEmbeddedImagesFromOneMailToAnother()
    Dim objMail As Outlook.MailItem
    Dim objMailDocument As Word.Document
    Dim objDocSelection As Word.Selection
    Dim objNewMail As Outlook.MailItem
    Dim objNewMailDocument As Word.Document
    Dim objInlineShape As Word.InlineShape
    Dim objShape As Word.Shape
 
    'Get the source email
    Select Case Outlook.Application.ActiveWindow.Class
           Case olInspector
                Set objMail = ActiveInspector.CurrentItem
           Case olExplorer
                Set objMail = ActiveExplorer.Selection.Item(1)
    End Select
 
    'Copy the entire email to a new email
    Set objMailDocument = objMail.GetInspector.WordEditor
    Set objDocSelection = objMailDocument.Application.Selection
    objDocSelection.WholeStory
    objDocSelection.Copy
  
    Set objNewMail = Outlook.Application.CreateItem(olMailItem)
    objNewMail.Display
    Set objNewMailDocument = objNewMail.GetInspector.WordEditor
    objNewMailDocument.Application.Selection.PasteAndFormat (wdUseDestinationStylesRecovery)

    For Each objInlineShape In objNewMailDocument.InlineShapes
        objInlineShape.ConvertToShape
    Next
 
    'Clear the text in the new email
    With objNewMailDocument.Content.Find
         .ClearFormatting
         .Replacement.ClearFormatting
         .Text = "[^2-^255]{1,}"
         .Replacement.Text = ""
         .MatchWildcards = True
         .Execute Replace:=wdReplaceAll
    End With
 
    Do While objNewMailDocument.Shapes.Count > 0
       For Each objShape In objNewMailDocument.Shapes
           objShape.ConvertToInlineShape
       Next
    Loop
End Sub

VBA Code - Batch Copy All Embedded Images from One Email to Another

  1. After that, add this macro to Quick Access Toolbar or ribbon.
  2. Eventually, try this macro at will.
  • To begin with, select or open the email from which you intend to copy its images.
  • Then, click the newly added macro button.Run Macro
  • At once, a new email will be displayed. As you can see in the screenshot below, it contains the images copied from the source email.Copied Images in New Mail

Recognize Signs of Outlook Corruption

It is known that Outlook is prone to errors and corruption. Therefore, in order to prevent Outlook data corruption, it is necessary to known some of its early signs. For instance, provided that you find some items disappearing from time to time, or Outlook is susceptible to crash or you frequently receive error messages, you’d better raise vigilance. All of such matters are indicating that Outlook tends to get damaged. In such cases, you ought to prepare a reliable Outlook fix tool, such as DataNumen Outlook Repair, for later Outlook recovery.

Author Introduction:

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

Comments are closed.