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.
Method 1: Batch Center All Images via “Find & Replace”
- At first, in the opened email window, press “Ctrl + H” key buttons.
- In the popup “Find and Replace” dialog box, on “Replace” tab, type “^g” in the “Find what” field.
- Then, click in the “Replace with” field and press “Ctrl +E”.
- After that, click the “Replace All” button.
- Immediately, all the embedded images will be centered, like the screenshot below.
Method 2: Batch Center All Images with VBA
- In the first place, press “Alt + F11” to access VBA editor.
- Then, enable “Word Object Library” according to the article – “How to Add an Object Library Reference in VBA“.
- 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
- After that, add this macro to Quick Access Toolbar of Message window with reference to “How to Run VBA Code in Your Outlook“.
- Later, access the email and click the macro button in Quick Access Toolbar.
- At once, all images are moved to center.
Method 3: Auto Center All Images when Sending the Email via VBA
- 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
- After that, send the email directly. Outlook will auto center them 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.
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