Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2005

Tip: Looking for answers? Try searching our database.

Find Image Files in Word Document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mmikedm1000 - 10 Nov 2005 00:39 GMT
Hi,
Is there a way to use a macro, or a report, to generate a list of all images
that are linked in a MS Word document.
Signature

Michael

mmikedm1000 - 11 Nov 2005 00:05 GMT
I have a macro that will search for images, but how do I copy that
information into another document.  I would like to have image name,
location, header text, source file name and location if at all possible.  
Here is what I have thus far

  Selection.HomeKey Unit:=wdStory
  Selection.Find.ClearFormatting
   
   With Selection.Find
       .Text = "^g"
       .Replacement.Text = ""
       .Forward = True
       .Wrap = wdFindContinue
       .Format = False
       .MatchCase = False
       .MatchWholeWord = False
       .MatchWildcards = False
       .MatchSoundsLike = False
       .MatchAllWordForms = False
   End With
   Selection.Find.Execute
Helmut Weber - 11 Nov 2005 12:57 GMT
Hi Mike,

sorry to say so,
but there is no such thing as an image in Word,
that is to say, there is no image object in Word.

There are shapes and inlineshapes of a variety of types.
I couldn't find a caption property nor a header text property.
Nor can I see a location property in a straightforward way.

I think you are on the wrong track.

Though, this one might help you:

With ActiveDocument.Shapes(1)
  MsgBox .LinkFormat.SourceFullName
End With
With ActiveDocument.InlineShapes(1)
  .Select
  MsgBox .LinkFormat.SourceName
End With

assuming, that the first shape
as well as the first inlineshape are linked.

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

mmikedm1000 - 11 Nov 2005 15:11 GMT
Helmut,

I think I may have worded my question poorly.  My documents have objects
inserted from insert object, create from file, link to file.  Those images
are the ones I want to see if it is possible to create a macro that would go
through a document and export pertinent information to another document.  In
essence, for a large document telling me what images are in that document.  
Is this at all possible?

Thanks for you help.
Signature

Michael

> Hi Mike,
>
[quoted text clipped - 20 lines]
> assuming, that the first shape
> as well as the first inlineshape are linked.
Helmut Weber - 11 Nov 2005 21:29 GMT
Hi Michael,

>I think I may have worded my question poorly.  My documents have objects
>inserted from insert object, create from file, link to file.  Those images
>are the ones I want to see if it is possible to create a macro that would go
>through a document and export pertinent information to another document.  In
>essence, for a large document telling me what images are in that document.
 
>>> Is this at all possible?

This is the hardest question of all.

I think, no, as when not linked, the inserted object,
lets say it is a picture, seems to become an entire part
of the doc and all it's traces are lost.

Sure you can loop through all inlineshapes and all shapes,
check whether they are linked or not, and if linked,
extract to what file they are linked.

You may obtain a list with autoshape1, autoshape2, etc.,
but this is certainly not what you want.

But, when inserting objects, here and now
Word offers 36 different types!

At least I couldn't manage, having inserted a wav-sound
as an inlineshape, which is the default,
to find out programmatically, what sound it was.

As lots of other people are reading here
and don't hesitate to speak up, if they know better
I'd say, no way. Or make a passion out of it,
and show us how to do it.

Every lesson is appreciated. ;-)

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

mmikedm1000 - 11 Nov 2005 21:43 GMT
Thank you for your assistance.
Signature

Michael

> Hi Michael,
>
[quoted text clipped - 32 lines]
>
> Every lesson is appreciated. ;-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.