How to count the number of images in a Word document?
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:
- Click Home > Find > Advanced Find.
- 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.
- The number of inline images in the document will be displayed at the bottom of the dialog box.
Office Tab: Brings tabbed interfaces to Word, Excel, PowerPoint...![]() |
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.
- On the Kutools tab, select Batch Replacement.
- In the Batch Find and Replace dialog box, configure the settings as follows:
- Click Add Row to create a rule for finding inline images.
- In the Find field of the added row, type ^g (indicating inline image placeholders).
- Click the Add button and select Add Files or Add Folder to import the documents where you want to count the inline images.
- Click Find to execute the find-and-count operation across all selected documents.
- 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.
That's it! The number of inline images in each selected document is now counted and displayed at once.
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:
- Hold down the Alt + F11 keys to open the Microsoft Visual Basic for Applications window.
- 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
- 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.
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 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
- π€ Kutools AI Features: AI Assistant / Real-Time Assistant / Super Polish / Super Translate / AI Redaction / AI Proofread
- π Document Mastery: Split Pages / Merge Documents / Batch Convert to PDF
- β Contents Editing: Batch Find and Replace / Resize All Pictures
- π§Ή Effortless Clean: Remove Extra Spaces / Remove Section Breaks
- β Creative Inserts: Insert Thousand Separators / Insert Check Boxes / Create QR Codes
- π Supports 40+ Languages: Kutools speaks your language β 40+ languages supported!