List of inserted graphics

G

Graphic question

How do I compile a list of the file names of all the graphics I inserted into
a Word document?

I have added graphics by Insert > Picture > From File and saved and linked
to the file. I've added and deleted graphics and now need to compile a list
of the graphics actually used in the document. How do I do this?

Thanks.
 
M

macropod

Hi,

There are two ways:
1. Press Alt-F9 to reveal the field codes. Any linked pictures that haven't been set to 'in-line with text' will appear as
'{INCLUDEPICTURE "C:\\My Documents\\PicName.jpg"}', where "C:\\My Documents\\PicName.jpg" is the file's path and name.
2. Use a macro to extract the name & path details from all INCLUDEPICTURE fields.

Cheers
 
G

Graphic question

Thanks for the response.

Does that mean that if it is set to in-line with text, there is no way to
retrieve this information?

macropod said:
Hi,

There are two ways:
1. Press Alt-F9 to reveal the field codes. Any linked pictures that haven't been set to 'in-line with text' will appear as
'{INCLUDEPICTURE "C:\\My Documents\\PicName.jpg"}', where "C:\\My Documents\\PicName.jpg" is the file's path and name.
2. Use a macro to extract the name & path details from all INCLUDEPICTURE fields.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Graphic question said:
How do I compile a list of the file names of all the graphics I inserted into
a Word document?

I have added graphics by Insert > Picture > From File and saved and linked
to the file. I've added and deleted graphics and now need to compile a list
of the graphics actually used in the document. How do I do this?

Thanks.
 
M

macropod

Hi,

Sorry, it's 'square' pictures that might cause difficulty. In any event, using a macro like the one below will do the job.

Sub ListLinkedImages()
Dim oFld As Field
If ActiveDocument.Fields.Count > 0 Then
For Each oFld In ActiveDocument.Fields
If oFld.Type = wdFieldIncludePicture Then
With Selection
.EndKey Unit:=wdStory
.InsertAfter vbCrLf
.EndKey Unit:=wdStory
.TypeText Text:=oFld.LinkFormat.SourceFullName
End With
End If
Next oFld
End If
End Sub

The list is created at the end of the document.

Note: This may not work with Word 2007, which seems to have implemented a new way of linking to images.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Graphic question said:
Thanks for the response.

Does that mean that if it is set to in-line with text, there is no way to
retrieve this information?

macropod said:
Hi,

There are two ways:
1. Press Alt-F9 to reveal the field codes. Any linked pictures that haven't been set to 'in-line with text' will appear as
'{INCLUDEPICTURE "C:\\My Documents\\PicName.jpg"}', where "C:\\My Documents\\PicName.jpg" is the file's path and name.
2. Use a macro to extract the name & path details from all INCLUDEPICTURE fields.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Graphic question said:
How do I compile a list of the file names of all the graphics I inserted into
a Word document?

I have added graphics by Insert > Picture > From File and saved and linked
to the file. I've added and deleted graphics and now need to compile a list
of the graphics actually used in the document. How do I do this?

Thanks.
 
G

Graphic Question

Thanks so much! This worked great. For some reason Alt-F9 doesn't always
work, but this marco does what I need.

I appreciate your help.

macropod said:
Hi,

Sorry, it's 'square' pictures that might cause difficulty. In any event, using a macro like the one below will do the job.

Sub ListLinkedImages()
Dim oFld As Field
If ActiveDocument.Fields.Count > 0 Then
For Each oFld In ActiveDocument.Fields
If oFld.Type = wdFieldIncludePicture Then
With Selection
.EndKey Unit:=wdStory
.InsertAfter vbCrLf
.EndKey Unit:=wdStory
.TypeText Text:=oFld.LinkFormat.SourceFullName
End With
End If
Next oFld
End If
End Sub

The list is created at the end of the document.

Note: This may not work with Word 2007, which seems to have implemented a new way of linking to images.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

Graphic question said:
Thanks for the response.

Does that mean that if it is set to in-line with text, there is no way to
retrieve this information?

macropod said:
Hi,

There are two ways:
1. Press Alt-F9 to reveal the field codes. Any linked pictures that haven't been set to 'in-line with text' will appear as
'{INCLUDEPICTURE "C:\\My Documents\\PicName.jpg"}', where "C:\\My Documents\\PicName.jpg" is the file's path and name.
2. Use a macro to extract the name & path details from all INCLUDEPICTURE fields.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

How do I compile a list of the file names of all the graphics I inserted into
a Word document?

I have added graphics by Insert > Picture > From File and saved and linked
to the file. I've added and deleted graphics and now need to compile a list
of the graphics actually used in the document. How do I do this?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top