> Must still be doing something wrong - macro doesn't link anything. I have
> tried a very simple two image document with images in same folder as doc
[quoted text clipped - 47 lines]
>> >> > be
>> >> > done?
Images are inline so used:
Dim pShape As Word.Shape
Const pNewFolder = "c:\tmg6\reports\"
For Each pShape In ActiveDocument.InlineShapes
pShape.LinkFormat.SourceFullName = pNewFolder & pShape.LinkFormat.SourceName
Next
I verified folder for images and the images by name in the folder. It is the
same as the document is in. I can go to edit>link, select all the images,
update and that works just fine.
I use the following routine after the photos are linked and showing to
resize, it works just fine:
Sub ResizePhotos()
Dim PreferredHeight As Integer
Dim MaximWidth As Integer
PreferredHeight = InputBox("Enter height in points (72pts/in,
28pts/cm)", , 108)
MaximWidth = InputBox("Enter maximum allowable width in points", , 144)
For Each iShape In ActiveDocument.InlineShapes
With iShape
ImageWidth = .Width
ImageHeight = .Height
NewHeight = PreferredHeight
NewWidth = Round(NewHeight * ImageWidth / ImageHeight)
If NewWidth > MaximWidth Then
NewWidth = MaximWidth
NewHeight = Round(NewWidth * ImageHeight / ImageWidth)
End If
.Height = NewHeight
.Width = NewWidth
End With
Next
End Sub

Signature
Bob Berg
> Are you images floating or inline? If they are inline, replace
> "ActiveDocument.Shapes" with "ActiveDocument.InlineShapes"
[quoted text clipped - 50 lines]
> >> >> > be
> >> >> > done?
Jean-Guy Marcil - 13 Sep 2006 01:20 GMT
Bob Berg was telling us:
Bob Berg nous racontait que :
> Images are inline so used:
> Dim pShape As Word.Shape
> Const pNewFolder = "c:\tmg6\reports\"
> For Each pShape In ActiveDocument.InlineShapes
> pShape.LinkFormat.SourceFullName = pNewFolder &
> pShape.LinkFormat.SourceName Next
I am guessing it did not work.. You never mention that fact in your reply.
By reading between the lines, I guess you still have a problem, it is more
helpful to those helping you when you are explicit... ;-)
In any case, I see that you changed the Shapes to InlineShape as suggested
by Jezebel, but you did not change the variable assignment, try also
changing:
Dim pShape As Word.Shape
for
Dim pShape As Word.InlineShape
Otherwise you are telling Word to look for a Shape in the InlineShape
collection, and there aren't any! :-)

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Bob Berg - 13 Sep 2006 10:25 GMT
I am now trying:
Sub TMGPhotoLink()
Dim pShape As Word.InlineShape
Const pNewFolder = "c:\tmg6\reports\"
For Each pShape In ActiveDocument.InlineShapes
pShape.LinkFormat.SourceFullName = pNewFolder & pShape.LinkFormat.SourceName
Next
End Sub
Still doesn't work, by the way using Word 2003
Bob Berg

Signature
Bob Berg
> Bob Berg was telling us:
> Bob Berg nous racontait que :
[quoted text clipped - 22 lines]
> Otherwise you are telling Word to look for a Shape in the InlineShape
> collection, and there aren't any! :-)
Jean-Guy Marcil - 13 Sep 2006 12:07 GMT
Bob Berg was telling us:
Bob Berg nous racontait que :
> I am now trying:
>
[quoted text clipped - 10 lines]
>
> Still doesn't work, by the way using Word 2003
I have just tried the code you posted by doing the following:
1) Created a blank document;
2) Added two linked inline images located at:
"X:\Office 2003\OriginalFolder\"
(To make sure they are inline, select an image, do SHIFT-F9
and you should see an INCLUDEPICTURE field instead of
the image, do F9 to update the image and hide the field code)
3) Moved the images to:
"X:\Office 2003\NewFolder\"
4) Updated the images in the document;
5) As expected, the images were replaced by a red "X" in a white rectangle;
6) Ran this code:
Sub TMGPhotoLink()
Dim pShape As Word.InlineShape
Const pNewFolder = "X:\Office 2003\NewFolder\"
For Each pShape In ActiveDocument.InlineShapes
pShape.LinkFormat.SourceFullName = pNewFolder & _
pShape.LinkFormat.SourceName
Next
End Sub
7) The images were automatically updated;
8) Just to be sure, I selected the images and hit SHIFT-F9 to see the field
code;
9) The new path was there.
You only stated "Still doesn't work". This doesn't give us much to go on.
You have to be more explicit.
Is the macro running seemingly OK, but images are still represented by
red "X"'s?
Do you get an error message?
I would suggest you try the 9 steps above with a brand new document.
If it works, then compare those 9 steps with you have done with your current
document. What is the difference?
If it does not, post back describing exactly what you have done and the
on-screen results.

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org