shape.Parent doesn't return Slide
In most cases shape.Parent
is the slide that contains the shape.
However, if you try to delete a a group and then press on undo (the shapes will reappear) but the child shapes will throw exception for both .Pa开发者_开发百科rent
and .ParentGroup
.
How can I find out the slide ID of a shape in the case above?
I did your instructions and didn't have any problems. I added two shapes to an emtpy blank slide and and then deleted them both at the same time and then did Ctrl+Z. then I ran this in the immediate window -
?ActivePresentation.Slides(1).Shapes(1).Parent.SlideIndex
And it worked and showed a value of 1.
So then I thought you had these as a group, so i grouped the two shapes and did the same as above. And it worked just fine.
精彩评论