Error trying to set relative path on linked powerpoint presentation 
Author Message
 Error trying to set relative path on linked powerpoint presentation

I use PPT2002. I wrote a small VB program to change links to linked
presentations from full path names to relative (no path).  The presentation
and the linked presentations are in the same directory.

When I try to set the SourceFullName to a relative path I get a VB error as
LinkFormat(Unknown Member): Failed

Works fine when I use the full path name.  I tried "pres 1.ppt" and ".\pres
1.ppt".  Should I be able to do this?

    With srcPres
        For slideCnt = 1 To .Slides.Count
            Set srcSlide = .Slides(slideCnt)
            With srcSlide
                For shapeCnt = 1 To .Shapes.Count
                    Set currShape = .Shapes(shapeCnt)
                    With currShape
                        If .Type = msoLinkedOLEObject Then
                            linkPath = .LinkFormat.SourceFullName
                            pathComponents = Split(linkPath, "\", -1)
'                            ' The last element is the file name

                  ---- Both of these fail -----

                            linkName = ".\" +
'                            linkName =
'                            ' reset to relative
                            .LinkFormat.SourceFullName = linkName

                ----- This works but defeats the purpose ----------
'                            .LinkFormat.SourceFullName =
"C:\myprojects\vbfixlinks\pres 1.ppt"
                        End If
                    End With
                Next shapeCnt

            End With    ' srcSlide
        Next slideCnt        ' end for
    End With            ' end with srcPres


Tue, 01 Feb 2005 22:21:53 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Newbie: trying to show a Powerpoint presentation in VB

2. I want absolute path in hyperlinks and linked pitures (word makes them relative)

3. Error adding a powerpoint presentation to a ppt object

4. Error while adding a powerpoint presentation to ppt object

5. Use relative path for linked table in Access?

6. Setting Save As path in Powerpoint using VBA

7. Parsing an HTML Document - Change Relative paths to fully qualified paths

8. Best method of determining path, relative path and/or flie name

9. convert absolut path to relative path

10. Creating relative directory path given fully-qualified path

11. Updating PowerPoint Presentation graphs using data from Access

12. Export reports to powerpoint presentation


Powered by phpBB® Forum Software