![]() |
|
#1
|
|||
|
|||
|
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
|
| Tags |
| vba, word vba |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Insert multiple images in table with filename in column to the side
|
Kass | Word VBA | 2 | 05-03-2018 08:14 AM |
| Extract embedded images and save according to hyperlink. | PRA007 | Word VBA | 2 | 02-05-2016 01:46 AM |
How do i include embedded images in a mail-merge?
|
Hindmost | Mail Merge | 14 | 09-18-2015 02:01 PM |
| Source code for embedded images | whitland | Outlook | 0 | 09-06-2011 03:59 AM |
| simple way to save embedded images? | Newmarket2 | Drawing and Graphics | 0 | 03-12-2010 12:24 PM |