Как предложил Стив Риндсберг, вы должны работать с ShapeObject.LinkFormat.SourceFullName
.Ниже будут перечислены все фигуры во всех слайдах для активного представления.Это должно помочь вам решить, что делать дальше.
[LinkFormat.SourceFullName] будет добавлено, когда будет доступно.
Option Explicit
Sub ListAllShapesType()
Dim oSlide As Slide, oShp As Shape, i As Long
For Each oSlide In ActivePresentation.Slides
Debug.Print "SLIDE(" & oSlide.SlideIndex & "): """ & oSlide.Name & """"
i = 1
For Each oShp In oSlide.Shapes
Debug.Print " #" & i, """" & oShp.Name & """", "Type:=" & WhatShapeType(oShp)
i = i + 1
Next oShp
Debug.Print
Next oSlide
End Sub
Function WhatShapeType(ShapeObject As Shape) As String
Dim sType As String
On Error Resume Next
Select Case ShapeObject.Type
Case msoAutoShape: sType = msoAutoShape & " (msoAutoShape)"
Case msoCallout: sType = msoCallout & " (msoCallout)"
Case msoCanvas: sType = msoCanvas & " (msoCanvas)"
Case msoChart: sType = msoChart & " (msoChart)"
Case msoComment: sType = msoComment & " (msoComment)"
Case msoContentApp: sType = msoContentApp & " (msoContentApp)"
Case msoDiagram: sType = msoDiagram & " (msoDiagram)"
Case msoEmbeddedOLEObject: sType = msoEmbeddedOLEObject & " (msoEmbeddedOLEObject)"
Case msoFormControl: sType = msoFormControl & " (msoFormControl)"
Case msoFreeform: sType = msoFreeform & " (msoFreeform)"
Case msoGroup: sType = msoGroup & " (msoGroup)"
Case msoInk: sType = msoInk & " (msoInk)"
Case msoInkComment: sType = msoInkComment & " (msoInkComment)"
Case msoLine: sType = msoLine & " (msoLine)"
Case msoLinkedOLEObject: sType = msoLinkedOLEObject & " (msoLinkedOLEObject)"
Case msoLinkedPicture: sType = msoLinkedPicture & " (msoLinkedPicture)"
Case msoMedia: sType = msoMedia & " (msoMedia)"
Case msoOLEControlObject: sType = msoOLEControlObject & " (msoOLEControlObject)"
Case msoPicture: sType = msoPicture & " (msoPicture)"
Case msoPlaceholder: sType = msoPlaceholder & " (msoPlaceholder)"
Case msoScriptAnchor: sType = msoScriptAnchor & " (msoScriptAnchor)"
Case msoShapeTypeMixed: sType = msoShapeTypeMixed & " (msoShapeTypeMixed)"
Case msoSlicer: sType = msoSlicer & " (msoSlicer)"
Case msoSmartArt: sType = msoSmartArt & " (msoSmartArt)"
Case msoTable: sType = msoTable & " (msoTable)"
Case msoTextBox: sType = msoTextBox & " (msoTextBox)"
Case msoTextEffect: sType = msoTextEffect & " (msoTextEffect)"
Case msoWebVideo: sType = msoWebVideo & " (msoWebVideo)"
Case Else: sType = ShapeObject.Type & " (Undocumented type!)"
End Select
sType = sType & " [" & ShapeObject.LinkFormat.SourceFullName & "]"
WhatShapeType = sType
End Function
Option Explicit
Sub ListAllShapesType()
Dim oSlide As Slide, oShp As Shape, i As Long
For Each oSlide In ActivePresentation.Slides
Debug.Print "SLIDE(" & oSlide.SlideIndex & "): """ & oSlide.Name & """"
i = 1
For Each oShp In oSlide.Shapes
Debug.Print " #" & i, """" & oShp.Name & """", "Type:=" & WhatShapeType(oShp)
i = i + 1
Next oShp
Debug.Print
Next oSlide
End Sub
Function WhatShapeType(ShapeObject As Shape) As String
Dim sType As String
On Error Resume Next
Select Case ShapeObject.Type
Case msoAutoShape: sType = msoAutoShape & " (msoAutoShape)"
Case msoCallout: sType = msoCallout & " (msoCallout)"
Case msoCanvas: sType = msoCanvas & " (msoCanvas)"
Case msoChart: sType = msoChart & " (msoChart)"
Case msoComment: sType = msoComment & " (msoComment)"
Case msoContentApp: sType = msoContentApp & " (msoContentApp)"
Case msoDiagram: sType = msoDiagram & " (msoDiagram)"
Case msoEmbeddedOLEObject: sType = msoEmbeddedOLEObject & " (msoEmbeddedOLEObject)"
Case msoFormControl: sType = msoFormControl & " (msoFormControl)"
Case msoFreeform: sType = msoFreeform & " (msoFreeform)"
Case msoGroup: sType = msoGroup & " (msoGroup)"
Case msoInk: sType = msoInk & " (msoInk)"
Case msoInkComment: sType = msoInkComment & " (msoInkComment)"
Case msoLine: sType = msoLine & " (msoLine)"
Case msoLinkedOLEObject: sType = msoLinkedOLEObject & " (msoLinkedOLEObject)"
Case msoLinkedPicture: sType = msoLinkedPicture & " (msoLinkedPicture)"
Case msoMedia: sType = msoMedia & " (msoMedia)"
Case msoOLEControlObject: sType = msoOLEControlObject & " (msoOLEControlObject)"
Case msoPicture: sType = msoPicture & " (msoPicture)"
Case msoPlaceholder: sType = msoPlaceholder & " (msoPlaceholder)"
Case msoScriptAnchor: sType = msoScriptAnchor & " (msoScriptAnchor)"
Case msoShapeTypeMixed: sType = msoShapeTypeMixed & " (msoShapeTypeMixed)"
Case msoSlicer: sType = msoSlicer & " (msoSlicer)"
Case msoSmartArt: sType = msoSmartArt & " (msoSmartArt)"
Case msoTable: sType = msoTable & " (msoTable)"
Case msoTextBox: sType = msoTextBox & " (msoTextBox)"
Case msoTextEffect: sType = msoTextEffect & " (msoTextEffect)"
Case msoWebVideo: sType = msoWebVideo & " (msoWebVideo)"
Case Else: sType = ShapeObject.Type & " (Undocumented type!)"
End Select
' Append the LinkFormat detail if available (errors will not affect output)
sType = sType & " [" & ShapeObject.LinkFormat.SourceFullName & "]"
WhatShapeType = sType
End Function