Why did you change msoLinkedPicture to type 16? (type 16 isn't a linked
picture) Maybe you need to explain what you want to achieve.
Apart from that it works OK in 2007 here
--
Amazing PPT Hints, Tips and Tutorials-
http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
"Munna" wrote:
> Sorry John Wilson,
> The code I have send have some mistake,the real code is as given below,
>
> Sub RelPict()
> Dim oSlide As Slide
> Dim oShape As Shape
> Dim lPos As Long
> Dim strLink As String
> '
> ' Loop through the presentation checking each shape
> ' on each slide to see if it is a linked picture.
> '
> For Each oSlide In ActivePresentation.Slides
> For Each oShape In oSlide.Shapes
> If oShape.Type = 16 Then
> With oShape.LinkFormat
> '
> ' Search from the right hand portion of the source
> ' filename and find the first backslash "\" character.
> '
> lPos = InStrRev(.SourceFullName, "\")
> '
> ' Check to see if the link has already been modified.
> '
> If lPos <> 0 Then
> '
> ' Determine how long the filename is, by subtracting
> ' the position the "\" character was found at from
> ' the total length of the source file name.
> '
> lPos = Len(.SourceFullName) - lPos
> '
> ' Extract the filename from the source file name, then
> ' assign the filename to the source file name, turning
> ' it into a relative path.
> '
> strLink = Right(.SourceFullName, lPos)
> .SourceFullName = strLink
> End If
> End With
> End If
> Next oShape
> Next oSlide
> End Sub
>
> This code properly works in 2003,but shows an error message in
> powerpoint 2007.
> thanks a lot for your replay,
> With regards MUnna
>
>
>
>
>