Press Alt+Shift+F11 to launch the script editor. Look thru the html that is
generated for the relevant information. Once you know what to look for you
can pull the entire html into a string variable by using the HTML Project
object associated with the presentation and then parse it.
This is a hack which works on 2000+ versions and requires installation of
the Microsoft Script editor.
' ----- Beginning Of Code -----
Option Explicit
Sub Test()
Dim sExt As String
Dim oShp As Shape
Set oShp = ActiveWindow.Selection.ShapeRange(1)
sExt = GetImageExtension(oShp)
MsgBox sExt
End Sub
Function GetImageExtension(oCheckCopy As Object)
On Error GoTo ExitImageExtensionError
Dim oTmpPPT As Object
Dim sHTMLString As String
Dim sBuff As String
oCheckCopy.Copy
Set oTmpPPT = Presentations.Add(False)
With oTmpPPT.Slides.Add(1, ppLayoutBlank)
.Shapes.Paste
End With
sHTMLString = oTmpPPT.HTMLProject.HTMLProjectItems("Slide1").Text
If InStr(1, sHTMLString, "<v:imagedata src=" & Chr(34)) <> 0 Then
sBuff = Mid(sHTMLString, _
InStr(1, sHTMLString, "v:imagedata src=" & Chr(34)) _
+ Len("v:imagedata src=") + 1)
sBuff = Left(sBuff, InStr(1, sBuff, Chr(34)) - 1)
sBuff = Mid(sBuff, InStrRev(sBuff, ".") + 1)
End If
ExitImageExtensionError:
GetImageExtension = sBuff
oTmpPPT.Close
Set oTmpPPT = Nothing
End Function
' ----- End Of Code -----
--
Regards,
Shyam Pillai
Toolbox:
http://skp.mvps.org/toolbox