Skip to main content

Kutools for Office β€” One Suite. Five Tools. Get More Done.

How to count the number of images in a Word document?

Author Xiaoyang Last modified

Counting the number of images in a Word document can be useful for various purposes, such as quality control, compliance with guidelines, or simply for organizational reasons. Manually counting images in a lengthy document can be tedious and error-prone. Fortunately, there are efficient methods to quickly and accurately count the number of images in a Word document.

In this tutorial, we will guide you through the steps to easily count the number of images, helping you manage your document more effectively.

Count the number of inline images with Find and Replace feature

Count the number of inline images in multiple documents using Kutools for Word

Count the number of both inline images and floating shapes with VBA code


Count the number of inline images using the Find and Replace feature

The Find and Replace feature in Word allows you to quickly count the number of inline images. Follow these steps:

  1. Click Home > Find > Advanced Find.

    Advanced Find option on the Ribbon

  2. In the Find and Replace dialog box, under the Find tab, type ^g into the Find what text box. Then, select Main Document from the Find In drop-down list.

    Find and Replace dialog with '^g' in the Find what text box and 'Main Document' selected from the Find In drop down list

  3. The number of inline images in the document will be displayed at the bottom of the dialog box.

    Find and Replace dialog displaying the count of items matching the criteria

Office Tab: Brings tabbed interfaces to Word, Excel, PowerPoint...
Navigate through documents using Office Tab
Enhance your workflow now.      Learn More about Office Tab       Free Download

Count the number of inline images in multiple documents using Kutools for Word

Kutools for Word provides a quick and efficient way to count inline images across multiple documents. This tool simplifies the process, saving time and effort by automating the counting of image placeholders (denoted by ^g) within selected files.

Kutools for Word, equipped with AI πŸ€–, offers over 100 handy features to simplify your tasks.
  1. On the Kutools tab, select Batch Replacement.

    Batch Replacement option on the Kutools tab in Word ribbon

  2. In the Batch Find and Replace dialog box, configure the settings as follows:
    1. Click Add Row to create a rule for finding inline images.
    2. In the Find field of the added row, type ^g (indicating inline image placeholders).
    3. Click the Add button and select Add Files or Add Folder to import the documents where you want to count the inline images.
    4. Click Find to execute the find-and-count operation across all selected documents.

      Batch Find and Replace dialog with ^g in the Find field

  3. The Batch Find and Replace dialog box will switch to the Preview Result tab, where you can review the total count of inline images. Once satisfied, click Close.

    Batch Find and Replace dialog with preview results

That's it! The number of inline images in each selected document is now counted and displayed at once.

Kutools for Word is the ultimate Word add-in that streamlines your work and boosts your document processing skills. Get It Now!

Count the number of both inline images and floating shapes with VBA code

The previous methods only count inline images and do not include floating shapes in the document. To count both inline images and floating shapes, you can use the following VBA code. Follow these steps:

  1. Hold down the Alt + F11 keys to open the Microsoft Visual Basic for Applications window.
  2. Click Insert > Module. Copy and paste the following code into the blank module:
    Sub CountImagesInDoc()
        Dim xInlines As Long
        Dim xFloaters As Long
        Dim sh As Shape
        Dim tbxs As Long
        Dim msg As String
        With ActiveDocument
            For Each sh In .Shapes
                If sh.Type = msoTextBox Then tbxs = tbxs + 1
            Next
            xInlines = .InlineShapes.Count
            xFloaters = .Shapes.Count - tbxs
        End With
        xPrompt = "Inline images:" & vbTab & xInlines & vbCr
        xPrompt = xPrompt & "Floating shapes:" & vbTab & xFloaters & vbCr
        xPrompt = xPrompt & vbTab & "Total:" & vbTab & (xInlines + xFloaters) & vbCr
        xPrompt = xPrompt & "Counts do not include headers and footers, etc."
        MsgBox xPrompt, vbInformation, "Kutools for Word"
    End Sub
    
  3. After pasting the code, press F5 to run it. A prompt box will appear, displaying the number of inline images and floating shapes in the Word document.

    Success dialog


Best Office Productivity Tools

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

πŸ€– Kutools AI Features: AI Assistant / Real-Time Assistant / Super Polish (Preserve Format) / Super Translate (Preserve Format) / AI Redaction / AI Proofread...

πŸ“˜ Document Mastery: Split Pages / Merge Documents / Export Selection in Various Formats (PDF/TXT/DOC/HTML...) / Batch Convert to PDF...

✏ 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 / Text Boxes / Hyperlinks / For more removing tools, head to the Remove group...

βž• Creative Inserts: Insert Thousand Separators / Check Boxes / Radio Buttons / QR Code / Barcode / 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...

🌍 Supports 40+ Languages: Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Kutools and Kutools Plus tabs on the Word Ribbon
πŸ‘‰ Want to try these features? Download Kutools for Word now! πŸš€
 

✨ Kutools for Office – One Installation, Five Powerful Tools!

Includes Office Tab Pro Β· Kutools for Excel Β· Kutools for Outlook Β· Kutools for Word Β· Kutools for PowerPoint

πŸ“¦ Get all 5 tools in one suite | πŸ”— Seamless integration with Microsoft Office | ⚑ Save time and boost productivity instantly

Best Office Productivity Tools

Kutools for Word - 100+ Tools for Word