scan ppt objects for absolute / relative path

G

Gerald Maier

hi ng!

i want to write a vba-function to scan a ppt-file for integrated
"msoLinkedOLEObject" (movie files)
then i want to change the path of this object to a relative path.

i can handle everything in need except getting the information from the ppt
file

this is my function so far:

Function test()
Dim mydocument
Dim s
Set mydocument = ActivePresentation.Slides(1)
For Each s In ActivePresentation.Slides
Debug.Print s.Name
-> somethink like .pathComponents; .linkName; .linkPath, .type;.....
Next
End Function


plz help...
 
S

Shyam Pillai

Gerald,
The sample code below returns the path to the linked file, if it is not a
linked shape then it will return a blank string.
--
' ----- Beginning Of Code -----
Function GetSourceInfo(oShp As Shape) As String
On Error GoTo Error_GetSourceInfo
GetSourceInfo = oShp.LinkFormat.SourceFullName
Exit Function
Error_GetSourceInfo:
GetSourceInfo = ""
End Function

Sub HowToUseIt()
Dim oShape As Shape
Set oShape = ActivePresentation.Slides(1).Shapes(1)
Debug.Print GetSourceInfo(oShape)
End Sub
' ----- End Of Code -----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top