TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
Subject:Re: MS Word: how to get a list of graphics From:Geoff Lane <geoff -at- GJCTECH -dot- FORCE9 -dot- NET> Date:Wed, 9 Jun 1999 19:19:11 +0100
Jessica,
The following should do it:
Sub ListLinkedPics()
Dim i As Integer
Dim PicSource As String
For i = 1 To ActiveDocument.InlineShapes.Count
PicSource = LinkPath(i)
If Len(Trim(PicSource)) > 0 Then
MsgBox PicSource
End If
Next
End Sub
Function LinkPath(ByVal PicNum As Integer) As String
On Error GoTo err_LinkPath
LinkPath = ActiveDocument.InlineShapes(PicNum).LinkFormat.SourceFullName
Exit Function
err_LinkPath:
LinkPath = ""
Exit Function
End Function
Note that you need both the function and the subroutine. In a nutshell, the
function attempts to retrieve the full name and path of the picture. The
error handler caters for embedded pics, setting the returned value to an
empty string.
In the subroutine, replace MsgBox PicSource with your own code.
HTH,
Geoff Lane
Cornwall, UK
geoff -at- gjctech -dot- force9 -dot- net
-----Original Message-----
From: Jessica N. Lange
We link graphics (rather than embed them) in our Word documents. Does anyone
know of a way to generate a list of the graphics used in the document? Could
a macro do this?