Log in  \/ 
x
or
x
x
Register  \/ 
x

or

Kutools for Excel 22.00 HOT

300+ Powerful Features You Must Have in Excel

Kutools-for-Excel

Kutools for Excel is a powerful add-in that frees you from performing time-consuming operations in Excel, such as combine sheets quickly, merge cells without losing data, paste to only visible cells, count cells by color and so on. 300+ powerful features / functions for Excel 2019, 2016, 2013, 2010, 2007 or Office 365!

Read More Download Buy now

Office Tab 14.00HOT

Adding Tabbed Interface for Office

Office Tab

It enables tabbed browsing, editing, and managing of Microsoft Office applications. You can open multiple documents / files in a single tabbed window, such as using the browser IE 8/9/10, Firefox, and Google Chrome. It's compatible with Office 2019, 2016, 2013, 2010, 2007, 2003 or Office 365. Demo

Read More Download Buy now

Kutools for Outlook 13.00NEW

100+ Powerful Features for Outlook

Kutools-for-Outlook

Kutools for Outlook is a powerful add-in that frees you from time-consuming operations which majority of Outlook users has to perform daily! It can save your time from using Microsoft Outlook 2019, 2016, 2013, 2010 or Office 365!

Read More Download Buy now

Kutools for Word  9.00NEW

100+ Powerful Features for Word

Kutools-for-Word

Kutools for Word is a powerful add-in that frees you from time-consuming operations which majority of Word users have to perform daily! It can save your time from using Microsoft Word / Office 2019, 2016, 2013, 2010, 2007, 2003 or Office 365!

Read More Download Buy now

Classic Menu for Office

Bringing Back Your Familiar Menus

Restores the old look and menus of Office 2003 to Microsoft Office 2019, 2016, 2013, 2010, 2007 or Office 365. Don’t lose time in finding commands on the new Ribbon. Easy to deploy to all computers in enterprises and organizations.

Read More Download Buy now

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

If there are multiple graphics in your Word document that contain both inline images and floating shapes, now, you want to count the number of these graphics in the whole document, how could you get the number of images quickly and correctly?

Count the number of inline images with Find and Replace feature

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


Count the number of inline images with Find and Replace feature

The Find and Replace feature in Word can help you to count the number of inline pictures only quickly and easily, please do as follows:

1. Click Home > Find > Advanced Find, see screenshot:

doc count images 1

2. In the Find and Replace dialog box, under the Find tab, type the ^g into the Find what text box, and then choose Main Document from the Find In drop down list, see screenshot:

doc count images 2

3. And then you can see the number of the inline images in this Word document has been displayed as following screenshot shown:

doc count images 3


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

The above method can only count the number of inline images, if there are some floating shapes in the document, they will not be counted. The following VBA code can help you to count both the inline images and floating shapes, please do as this:

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

2. Then, click Insert > Module, copy and paste below code into the opened blank module, see screenshot:

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

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, then press F5 key to run this code, and a prompt box is popped out to tell you how many inline images and floating shapes in this Word document, see screenshot:

doc count images 4




Recommended Word Productivity Tools

 

Kutools For Word - More Than 100 Advanced Features For Word, Save Your 50% Time

  • Complicated and repeated operations can be done one-time processing in seconds.
  • Insert multiple images across folders into Word document at once.
  • Merge and combine multiple Word files across folders into one with your desired order.
  • Split the current document into separate documents according to heading, section break or other criteria.
  • Convert files between Doc and Docx, Docx and PDF, collection of tools for common conversions and selection, and so on...
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.

Feature Tutorials