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 insert multiple pictures with filename in Word document?

In Word document, you can quickly insert multiple pictures at once by using the Insert function. But, sometimes, you need to insert the file path and names as caption when inserting the pictures. How could you deal with this task in Word file?

Insert multiple pictures with filename by using VBA code

Insert multiple pictures with filename by using Kutools for Word


Insert multiple pictures with filename by using VBA code

The following VBA code can help you to insert the file path and name as caption when inserting the images, please do as this:

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

2. And then, click Insert > Module, copy and paste below code into the opened blank module:

VBA code: Insert multiple pictures with filename:

Sub PicWithCaption()
    Dim xFileDialog As FileDialog
    Dim xPath, xFile As Variant
    On Error Resume Next
    Set xFileDialog = Application.FileDialog(msoFileDialogFolderPicker)
    If xFileDialog.Show = -1 Then
        xPath = xFileDialog.SelectedItems.Item(1)
        If xPath <> "" Then
            xFile = Dir(xPath & "\*.*")
            Do While xFile <> ""
                If UCase(Right(xFile, 3)) = "PNG" Or _
                    UCase(Right(xFile, 3)) = "TIF" Or _
                    UCase(Right(xFile, 3)) = "JPG" Or _
                    UCase(Right(xFile, 3)) = "GIF" Or _
                    UCase(Right(xFile, 3)) = "BMP" Then
                    With Selection
                        .InlineShapes.AddPicture xPath & "\" & xFile, False, True
                        .InsertAfter vbCrLf
                        .MoveDown wdLine
                        .Text = xPath & "\" & xFile & Chr(10)
                        .MoveDown wdLine
                    End With
                End If
                xFile = Dir()
            Loop
        End If
    End If
End Sub

3. 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:

doc insert images with filename 1

4. Then click OK button, all the images in the selected folder have been inserted into the Word document, and the file path and name is inserted as caption we well, see screenshot:

doc insert images with filename 2


Insert multiple pictures with filename by using Kutools for Word

If you have Kutools for Word, with its Images feature, you can quickly insert multiple pictures with file path and name into the Word document immediately.

Kutools for Word : with more than 100 handy Word add-ins, free to try with no limitation in 60 days. 

After installing Kutools for Word, please do as this:

1. Click Kutools > Images, see screenshot:

doc insert images with filename 3

2. In the popped out Insert Pictures dialog box, please do the below operations:

  • (1.) Click Add Files or Add Folder button to select the images that you want to insert;
  • (2.) Then check Insert file path of each pictures as caption option at the left bottom of the dialog box;
  • (3.) And then click Insert button.

doc insert images with filename 4

3. After inserting the images, you will see each picture’s file path and name is inserted as well, see screenshot:

doc insert images with filename 5

Click to download Kutools for Word and free trial now!



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.
  • To post as a guest, your comment is unpublished.
    John · 2 months ago
    Which line of code would you change and how to have the file path written before the picture, aka the caption (filename) is above rather than below.
  • To post as a guest, your comment is unpublished.
    jairo aguirre · 10 months ago
    buenas noches amigo me ha servido mucho su información sinembargo me surge una duda cree que es posible incertar imagenes en word de la misma manera pero dentro de celdas incertadas?

Feature Tutorials