Skip to main content

How to insert multiple pictures with the same size in Word?

Author: Xiaoyang Last Modified: 2024-07-18

Normally, you can insert multiple images at once in a Word document with their original sizes. However, there are times when you need to ensure all images are the same size for a consistent and professional look. Manually resizing each image can be time-consuming. In this article, we will discuss how to insert multiple pictures with the same size in a Word document, providing a more efficient way to manage your images and maintain uniformity in your document’s layout.

Insert multiple pictures with the same size in Word with VBA

Resize all pictures to the same size based on a specific image with Kutools for Word


Insert multiple pictures with same size in Word document with VBA code

The following vba code can help you to insert multiple pictures and resize them to your specified size at once, please do as this:

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: insert multiple pictures with same size:

Sub InsertSpecificNumberOfPictureForEachPage()
    Dim xDlg As FileDialog
    Dim xFilePath As String
    Dim xFileName As String
    Dim xMsbBoxRtn As Long
    Dim xPicSize As String
    Dim xShape As InlineShape
    Set xDlg = Application.FileDialog(msoFileDialogFolderPicker)
    If xDlg.Show = -1 Then
        xFilePath = xDlg.SelectedItems(1) & "\"
    Else
        Exit Sub
    End If
    xFileName = Dir(xFilePath & "*.*", vbNormal)
    While xFileName <> ""
        If Not (Right(xFileName, 4) = ".png" Or Right(xFileName, 4) = ".bmp" _
        Or Right(xFileName, 4) = ".jpg" Or Right(xFileName, 4) = ".ico") Then
            GoTo LblCtn
        End If
        With Selection
            .InlineShapes.AddPicture xFilePath & xFileName, False, True
            .TypeParagraph
            .Collapse wdCollapsEnd
            .TypeText Left(xFileName, InStrRev(xFileName, ".") - 1)
            .ParagraphFormat.Alignment = wdAlignParagraphCenter
            .TypeParagraph
        End With
LblCtn:
        xFileName = Dir()
    Wend
    ActiveDocument.InlineShapes(1).Select
    Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
    xMsbBoxRtn = MsgBox("Do you want to resize all pictures?", vbYesNo, "Kutools for Word")
    If xMsbBoxRtn = 6 Then
        xPicSize = InputBox("Input the height and width of the picture, separated by comma", "Kutools for Word", "")
    End If
    For Each xShape In ActiveDocument.InlineShapes
      xShape.Height = Split(xPicSize, ",")(0)
      xShape.Width = Split(xPicSize, ",")(1)
    Next xShape
End Sub

3. And then, press F5 key to run this code, a Browse window is displayed, please select the folder that contains the images you want to insert, see screenshot:

Browse window

4. Then click OK button, and a prompt box is popped out to remind you if you want to resize the pictures, see screenshot:

Kutools for Word prompt box

5. Click Yes, and type the size numbers of the height and width which are separated by comma into the text box, see screenshot:

Set size

6. And then click OK, all the inserted images have been rearranged as the same size, see screenshot:

Result

Note: the unit size is pond in VBA code.


Resize all pictures to the same size based on a specific image with Kutools for Word

If multiple pictures exist in your Word document, with Kutools for Word’s Resize Images utility, you can quickly resize all images as same as the specific one.

Kutools for Word, equipped with AI 🤖, offers over 100 handy features to simplify your tasks.

After installing Kutools for Word, please do as this:

1. Adjust one picture to the size you want, and then select it, then click Kutools Plus > Resize > Resize Images with Selection, see screenshot:

Resize Images with Selection option of Kutools

2. And all images in this word document have been resized as same as the selected one immediately, see screenshot:

Result

Best Office Productivity Tools

Kutools for Word - Elevate Your Word Experience with Over 100 Remarkable Features!

🤖 Kutools AI Assistant: Transform your writing with AI - Generate Content  /  Rewrite Text  /  Summarize Documents  /  Get Quick Answers, all within Word

📘 Document Mastery: Split Pages  /  Merge Documents  /  Export Selection in Various Formats (PDF/TXT/DOC/HTML...)  /  Batch Convert to PDF  /  Export Pages as Images  /  Print Multiple Files at once...

Contents Editing: Batch Find and Replace across Multiple Files  /  Resize All Pictures  /  Transpose Table Rows and Columns  /  Convert Table to Text...

🧹 Effortless Clean: Sweap away Extra Spaces  /  Section Breaks  /  All Headers  /  Text Boxes  /  Hyperlinks  /  For more removing tools, head to the Remove group...

Creative Inserts: Insert Thousand Separators  /  Check Boxes  /  Radio Buttons  /  QR Code  /  Barcode  /  Diagonal Line Table  /  Equation Caption  /  Image Caption  /  Table Caption  /  Multiple Pictures  /  Discover more in the Insert group...

🔍 Precision Selections: Pinpoint Specific Pages  /  Tables  /  Shapes  /  Heading Paragraphs  /  Enhance navigation with more Select features...

Star Enhancements: Navigate to Any Location  /  Auto-Insert Repetitive Text  /  Toggle Between Document Windows  /  11 Conversion Tools...

Kutools and Kutools Plus tabs on the Word Ribbon
👉 Want to try these features? Download Kutools for Word now! 🚀
 
Comments (4)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Molto bello e utile! Non mi è chiara solo un a cosa, nel Codice VBA con criterio aumento/diminuisco le dimensioni delle immagini? Percentuale/rapporto? pixel? cm?
GRAZIE!
This comment was minimized by the moderator on the site
Hello, Grasselli
The unit size is pond in the above VBA code.
Thank you!
This comment was minimized by the moderator on the site
thanks for help ... it is very interesting ... big job ... good luck
This comment was minimized by the moderator on the site
Hi, hello
I'm Soda, I'm here to say that, I really learn a lot with your website and information that you give.
Thanks for that :)
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations