Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-18-2017, 01:33 AM
erik@haagensen.no erik@haagensen.no is offline Extracting list of embedded image file names from Word 2016 Windows 10 Extracting list of embedded image file names from Word 2016 Office 2016
Novice
Extracting list of embedded image file names from Word 2016
 
Join Date: Aug 2017
Location: Norway
Posts: 4
erik@haagensen.no is on a distinguished road
Default Extracting list of embedded image file names from Word 2016

I have about one hundred documents made with Word 2016.


There are several embedded images in each file.
Each image is picked from different folders on the same pc.

I need to have a list for each document with original image file names.


The image file names are present in the document code - I can find this manually if I mark an image, select properties, format and take a look at "Alternative text - Description". There it is! (See attachment)

But there are a lot of images, so is there a smart method that can extract a text list.
Preferably 1 line per image?
Attached Images
File Type: jpg Skjermbilde 2017-08-18 08.01.46.jpg (74.1 KB, 21 views)
Reply With Quote
  #2  
Old 08-18-2017, 02:34 PM
macropod's Avatar
macropod macropod is offline Extracting list of embedded image file names from Word 2016 Windows 7 64bit Extracting list of embedded image file names from Word 2016 Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try a macro like:
Code:
Sub Demo()
Dim Shp As Shape, iShp As InlineShape
Dim StrShp As String, StriShp As String
With ActiveDocument
  For Each iShp In .InlineShapes
    StriShp = StriShp & vbCr & iShp.AlternativeText
  Next
  For Each Shp In .Shapes
    StrShp = StrShp & vbCr & Shp.AlternativeText
  Next
  .Range.InsertAfter vbCr & "Inline Shapes:" & StriShp _
    & vbCr & vbCr & "Floating Shapes:" & StrShp
End With
End Sub
The macro writes the lists out at the end of the document - one for inline shapes, another for floating shapes.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 08-18-2017, 10:54 PM
erik@haagensen.no erik@haagensen.no is offline Extracting list of embedded image file names from Word 2016 Windows 10 Extracting list of embedded image file names from Word 2016 Office 2016
Novice
Extracting list of embedded image file names from Word 2016
 
Join Date: Aug 2017
Location: Norway
Posts: 4
erik@haagensen.no is on a distinguished road
Default

The generated list was just like I wanted.

Thanks a lot !!!
Reply With Quote
  #4  
Old 08-19-2017, 09:59 AM
erik@haagensen.no erik@haagensen.no is offline Extracting list of embedded image file names from Word 2016 Windows 10 Extracting list of embedded image file names from Word 2016 Office 2016
Novice
Extracting list of embedded image file names from Word 2016
 
Join Date: Aug 2017
Location: Norway
Posts: 4
erik@haagensen.no is on a distinguished road
Default

The given macro has been to great help!
However - can I add more image properties in the listing?

For ex. image file size properties like: Kb and pixel sizes.
Reply With Quote
  #5  
Old 08-19-2017, 02:35 PM
macropod's Avatar
macropod macropod is offline Extracting list of embedded image file names from Word 2016 Windows 7 64bit Extracting list of embedded image file names from Word 2016 Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Word doesn't store those data in a form accessible to VBA (Note: pixels don't really have a size; just horizontal & vertical counts, though the image metadata sometimes suggest a nominal scaling like 72dpi). To do something like you've asked for, you'd need code that takes the retrieved filename & path, then extracts those data from the original image (assuming it's still there!). However, even that can't be relied on as the image may have been compressed and/or cropped in Word, which can involve both reducing the pixel count and applying jpg compression to it - resulting in a much smaller file in Word than the file on disk. Furthermore, vector images don't have any pixel-related data.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 08-19-2017, 11:02 PM
erik@haagensen.no erik@haagensen.no is offline Extracting list of embedded image file names from Word 2016 Windows 10 Extracting list of embedded image file names from Word 2016 Office 2016
Novice
Extracting list of embedded image file names from Word 2016
 
Join Date: Aug 2017
Location: Norway
Posts: 4
erik@haagensen.no is on a distinguished road
Default

I understand.
Thank you for your explanation.
Reply With Quote
Reply

Tags
embedded images, original file name, word 2016

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to see names in merge since upgrading to Word 2016 thelighthouse Mail Merge 2 06-21-2017 06:55 AM
image display issue in word 2010 and word 2016 SashikalaB Word 5 01-09-2017 05:05 PM
Importing Google contacts from CSV file removes recipient names in autocomplete list weeneely Outlook 0 04-08-2016 07:51 AM
List bookmark names in word doc Hdata Word VBA 2 04-11-2015 05:03 AM
Extracting list of embedded image file names from Word 2016 Extracting information from Image in word Flambo Word 2 05-06-2012 10:43 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:58 AM.


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