KutoolsforOffice — One Suite. Five Tools. Get More Done.February Sale: 20% Off

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

AuthorXiaoyangLast modified

When working with Word documents, knowing exactly how many images are included can be important for meeting submission standards, monitoring content for reports, or keeping track of document structure for editing and publishing purposes. In lengthy or complex documents, manually counting every image is not only time-consuming but also leaves room for mistakes—images in headers, footers, or floating objects can easily be overlooked. That’s why mastering efficient methods to count images—whether they are inline, floating, or present in multiple files—can save you substantial time while improving document accuracy.

This tutorial explains practical methods for counting different types of image objects in Word, including inline pictures and floating shapes. With these methods, you can quickly determine image counts in a single document or even across multiple files, making document management and quality control more effective.

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 function in Word enables you to quickly tally inline images, making it a practical choice when you need an instant count in a single document. Inline images are pictures that behave like text characters and flow with the text. Note that this method does not count floating shapes such as text boxes, drawn shapes, or images formatted as "in front of text." It is most suitable when you want a quick count of regular inserted images, especially for compliance or layout review.

  1. Click Home > Find > Advanced Find.

    Advanced Find option on the Ribbon

  2. In the Find and Replace dialog box, go to the Find tab. Enter ^g (which is the special code for graphics, including inline pictures) into the Find what box. Then, to search the main content of your document, select Main Document from the Find In dropdown.

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

  3. Word will instantly report the total number of inline images matching your criteria, displaying the count at the bottom of the dialog box. The highlighted count represents the number of graphics (inline images) present in the main body of your document.

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

Tips and reminders: This method counts only inline images; floating objects such as images anchored to a paragraph or inserted as shapes will not be included. For more comprehensive counts, consider the VBA solution below. Also, ensure you are searching within the correct section (Main Document, not Header, Footer, etc.), as image content in those areas will be excluded. 

Navigate through documents using Office Tab

Office Tab

Tabbed navigation for Word, Excel, PowerPoint, and more—just like a web browser, with smooth switching in one window.


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

For situations where you need to evaluate image content across several documents simultaneously—such as compiling reports, batch editing, or fulfilling submission requirements for multiple files—Kutools for Word is an efficient solution. With its Batch Replacement feature, you can automate the process of searching for and counting inline images (using the ^g code) in a group of selected documents at once. This approach is especially helpful when manual document review would otherwise be slow and repetitive.

Kutools for Word

Kutools for Word helps you handle everyday document tasks faster with practical tools built right into Microsoft Word—no coding, no complex setup.

  • AI writing, polishing, translation, and summarization
  • Batch find and replace across documents
  • Merge and split Word documents easily
  • Batch Word ↔ PDF conversion
  1. On the Kutools tab, choose Batch Replacement to open the specialized dialog.

    Batch Replacement option on the Kutools tab in Word ribbon

  2. In the Batch Find and Replace dialog box, set up the search as follows:
    1. Click Add Row to insert a new search rule.
    2. In the new row’s Find field, enter ^g, which corresponds to all inline image placeholders in Word.
    3. Click Add and select either Add Files or Add Folder to fetch the documents you want to analyze. Both options allow you to select one or more Word documents at once based on your needs.
    4. Click Find to start the batch counting process.

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

  3. The system will switch to the Preview Result tab in the dialog box. Here, you will see a detailed count of inline images for each document you included, making it easy to spot files that meet or fall short of your image-related requirements. After reviewing the results, click Close to exit.

    Batch Find and Replace dialog with preview results

This batch method ensures you keep track of image counts across multiple documents without having to open each one individually. It’s ideal for editors, researchers, or anyone working with a set of documents that need consistent formatting. 

Want a faster way to handle similar tasks in Word? Try Kutools for Word and simplify your daily work.


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

Unlike the previous two methods, which are limited to inline images, using VBA (Visual Basic for Applications) allows you to count both inline images and floating shapes—including images inserted as shapes, watermarks, and more—in the main document body. This method is valuable if your document includes content formatted as floating images or other objects that move independently of the text, ensuring a more comprehensive and accurate count. Additionally, this approach can be customized for specific counting requirements.

  1. Select the document in which you want to count images, or place your cursor within the document window. Press Alt + F11 to open the Microsoft Visual Basic for Applications editor window.
  2. In the VBA editor, click Insert > Module to create a new module. Copy and paste the VBA code below into this module.

    VBA code: Count the number of inline images and floating shapes in the active document

    Sub CountImagesInDoc()
        Dim xInlines As Long
        Dim xFloaters As Long
        Dim sh As Shape
        Dim tbxs As Long
        Dim xPrompt As String
        On Error Resume Next
        xTitleId = "KutoolsforWord"
        With Application.ActiveDocument
            For Each sh In .Shapes
                If sh.Type = msoTextBox Then
                    tbxs = tbxs + 1
                End If
            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, xTitleId
        Set sh = Nothing
    End Sub
  3. After pasting the VBA code, press the F5 key or select Run to execute the code. A prompt will appear showing the count of inline images, floating shapes, and their total sum.

    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 for Word tabs on the ribbon
 
 

Office Tab - Brings Tabbed interface to Office, Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Free Download     Buy Now     Learn More
 

✨ 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