3 Easy Means to Batch Center All Images Embedded in Your Outlook Email

After inserting several images into your Outlook email, if you want to center them in bulk, you can read this article. Here we will teach you 3 ways to get it.

Are you accustomed to placing the inserted images in center when composing email? Many users prefer such a layout in email. However, generally, it demands users to center align the images manually. Without any doubt, that is too tedious, so isn’t a smart way. Therefore, in the followings, we will introduce 3 much more effective means.Batch Center All Images Embedded in Your Outlook Email

Method 1: Batch Center All Images via “Find & Replace”

  1. At first, in the opened email window, press “Ctrl + H” key buttons.
  2. In the popup “Find and Replace” dialog box, on “Replace” tab, type “^g” in the “Find what” field.
  3. Then, click in the “Replace with” field and press “Ctrl +E”.Find and Replace
  4. After that, click the “Replace All” button.
  5. Immediately, all the embedded images will be centered, like the screenshot below.Centered Images

Method 2: Batch Center All Images with VBA

  1. In the first place, press “Alt + F11” to access VBA editor.
  2. Then, enable “Word Object Library” according to the article – “How to Add an Object Library Reference in VBA“.
  3. Next, put the following VBA code into a module.
Sub BatchCenterAllImagesEmbeddedInEmail()
    Dim objMail As Outlook.MailItem
    Dim objMailDocument As Word.Document
    Dim objDocSelection As Word.Selection
 
    Set objMail = ActiveInspector.CurrentItem
    Set objMailDocument = objMail.GetInspector.WordEditor
    Set objDocSelection = objMailDocument.Application.Selection

    With objDocSelection.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Replacement.ParagraphFormat.Alignment = wdAlignParagraphCenter
        .Text = "^g"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .Execute Replace:=wdReplaceAll
    End With
End Sub

VBA Code - Batch Center All Images

  1. After that, add this macro to Quick Access Toolbar of Message window with reference to “How to Run VBA Code in Your Outlook“.
  2. Later, access the email and click the macro button in Quick Access Toolbar.
  3. At once, all images are moved to center.Run Macro to Batch Center All Images

Method 3: Auto Center All Images when Sending the Email via VBA

  1. In Outlook VBA editor, put the VBA code below into the “ThisOutlookSession” project.
'Auto center all pictures embedded in this email
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim objMail As Outlook.MailItem
    Dim objMailDocument As Word.Document
    Dim objInlineShape As Word.InlineShape
    Dim objDocSelection As Word.Selection
 
    If TypeName(Item) = "MailItem" Then
       Set objMail = Item
    End If
 
    If Not (objMail Is Nothing) Then
       Set objMailDocument = objMail.GetInspector.WordEditor

       For Each objInlineShape In objMailDocument.InlineShapes
           objInlineShape.Select
           Set objDocSelection = objMailDocument.Application.Selection
           objDocSelection.ParagraphFormat.Alignment = wdAlignParagraphCenter
       Next
    End If
End Sub

VBA Code - Auto Center All Images when Sending the Email

  1. After that, send the email directly. Outlook will auto center them on send.Auto Centered Images on Send

Avoid Outlook Data Corruption

Occasional errors or crashes have harassed a great amount of Outlook users. At best, the inbuilt tool can fix the issues with effortless ease. However, at times, the problems have drastically exceeds what the internal utility can do. At this point, it is necessary to employ a more powerful and specialized tool, such as DataNumen Outlook Repair. It can help you repair Outlook without breaking a sweat.

Author Introduction:

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