Sub sd()
Dim myShape As Shape
For Each myShape In ActiveDocument.Shapes
MsgBox myShape.LinkFormat.SourcePath
MsgBox myShape.LinkFormat.SourceName
Next myShape
End Sub
Any suggestions why?
I have also tried something like this...
Sub x()
Dim s As Section
Dim j As Shape
For Each s In ActiveDocument.Sections
For Each j In s.Headers(wdHeaderFooterPrimary).Shapes
If j.Type = 15 Then
MsgBox j.LinkFormat.SourcePath
MsgBox j.LinkFormat.SourceName
End If
Next j
For Each j In s.Headers(wdHeaderFooterEvenPages).Shapes
If j.Type = 15 Then
MsgBox j.LinkFormat.SourcePath
MsgBox j.LinkFormat.SourceName
End If
Next j
Next s
End Sub
And this again returned nothing?
thanks
Robin
The problem in the second macro is the hardcoded Type value 15 that
you're comparing to. The Shape.Type values are members of the
msoShapeType enumeration. The value 15 corresponds to msoTextEffect,
which indicates a WordArt object. If you want linked pictures, you
should check for j.Type = msoLinkedPicture, which has a numeric value
of 11. I recommend using the mnemonics instead of the numeric values
in all cases, as they would prevent problems like this one.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.