Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-21-2022, 12:56 AM
pulleng pulleng is offline Add filename to embedded images Windows 10 Add filename to embedded images Office 2016
Novice
Add filename to embedded images
 
Join Date: Jul 2022
Posts: 2
pulleng is on a distinguished road
Question Add filename to embedded images

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

Reply With Quote
 

Tags
vba, word vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add filename to embedded images 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
Add filename to embedded images 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

Other Forums: Access Forums

All times are GMT -7. The time now is 12:48 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft