开发者

shape.Parent doesn't return Slide

开发者 https://www.devze.com 2023-01-09 02:09 出处:网络
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 fo

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号