I have a word file that has images embedded. I want to add a caption below each image to show the filename. I know how to loop through the images and add a caption (code below) but how can I find the original file name please?
Code:
Option Explicit
Sub Example1()
Dim intCount As Integer
Dim i As Integer
For i = 1 To InlineShapes.Count
'check if the current shape is a picture
If InlineShapes.Item(i).Type = _
wdInlineShapePicture Then
'select the picture
InlineShapes.Item(i).Select
'assign a caption to it
Selection.InsertCaption Label:="Figure", _
Title:="WHERE DO I FIND THE FIENAME TO ADD?", _
Position:=wdCaptionPositionBelow
End If
Next i
End Sub