Display and print file names for .jpeg images embedded, Word 2003?

H

hubernut

Is is possible to display and print file names for .jpeg graphics embedded in
a Word 2003 document? I would like to be able to specify a place on page for
the original file name (preferably not, but possibly, the entire file path
name) to appear, a different name (of course) for each graphic. I envision
one graphic per page times dozens of pages, each graphic having its original
file name printed on its page. These are photographic images stamped with
file names by the cameras.
 
J

Jay Freedman

Is is possible to display and print file names for .jpeg graphics embedded in
a Word 2003 document? I would like to be able to specify a place on page for
the original file name (preferably not, but possibly, the entire file path
name) to appear, a different name (of course) for each graphic. I envision
one graphic per page times dozens of pages, each graphic having its original
file name printed on its page. These are photographic images stamped with
file names by the cameras.

It depends on what you mean by "embedded". If you link to the files,
the link is a field containing the file's path and name, and a macro
can add that information as plain text below the picture. If you
simply paste the picture into the document, Word doesn't have any
information about where it came from, and there's nothing left to work
with.

To link to a picture file, use the Insert > Picture > From File
command; in the dialog, after selecting the file, click the down arrow
next to the Insert button and choose either "Link to File" or "Insert
and Link".

To make the macro work, the picture has to be in line with text, not
floating (Square, Top & Bottom, etc.). In Tools > Options > Edit, set
the default for pasting pictures to In Line With Text. If you need to
position the picture on the page, link it into a cell of a table.

For the macro, use this (see
http://www.gmayor.com/installing_macro.htm if needed):

Sub ShowPictureNames()
Dim picFld As Field
Dim picCode As Variant
Dim picPath As String
For Each picFld In Selection.Paragraphs(1).Range.Fields
If picFld.Type = wdFieldIncludePicture Then
picCode = Split(picFld.Code.Text, Chr(34))
picPath = picCode(1)
picPath = Replace(picPath, "\\", "\")
Selection.InsertAfter vbCr & picPath
Selection.Collapse wdCollapseEnd
End If
Next
End Sub

Run the macro (from a toolbar button or keyboard shortcut) when either
the picture itself is selected or the cursor is in the same paragraph
with the picture.
 
H

hubernut

This strikes me as a great tip--and quite detailed! Is there any way to run a
macro affecting an entire series of selected graphics, to which the MSWord is
to link, with the respective file name of each graphic displayed on page with
the graphic, one graphic and file name per page? I anticipate this round
having about 5000-6000 images to process!

hubernut
 
J

Jay Freedman

That could be done, but the macro would have to be carefully matched
to the formatting of the document that it will operate on. If the
macro makes incorrect assumptions about what it will find in the
document, the result could be a mess that takes longer to fix than it
would have taken to do the job manually in the first place. "To err is
human; to really foul up takes a computer." :)

If you care to email me a small sample, I can modify the macro as
needed.
 
H

hubernut

I'd be happy to send an example. However, the items involved can be flexibly
set. I need to have one graphic per page, approx. 6 x 9 inches, with some
consistent place on the page for a label giving the file name for that
graphic. With that in mind, would it help if I emailed an MSWord file with
one graphic inlaid on one page as an example? I'm wondering how one would
specify where the title would be placed. Could it be appended into space
reserved for the header/footer?

I do appreciate so much having the benefit of your advice.

hubernut
 
J

Jay Freedman

It would be better to send a document with two graphics on two pages,
so I can see how you're separating them.

The file name could be placed in a frame or text box positioned
wherever you think is best. It wouldn't be good to put it in the
actual header or footer, because that would require a section break at
the start of each page, which is something to avoid.
 

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