Get shape by Id or Name

前端 未结 4 1491
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-11 18:55

Is there any way to get a shape if you know its Id?

For example:

Dim myshape As Shape
myshape.Id = 42
myshape = getShapeById(myshape.Id)         


        
4条回答
  •  佛祖请我去吃肉
    2020-12-11 19:01

    To get a Shape by Name, you do...:

    Function getShapeByName(shapeName As String, Slide As Integer)
        Set getShapeByName = ActivePresentation.Slides(Slide).Shapes(shapeName)
    End Function
    
    Dim myshape As Shape
    myshape = getShapeByName("Rectangle 42", 1)
    

提交回复
热议问题