none
How to detect shape selected within a group in PowerPoint C#? RRS feed

  • Question

  • Hi,
    I need to detect selected shape within the group for changing properties of it.
    The group has many shapes of several "types" by their Name property (e.g. I have 3 types of shape), programmatically generated, so I have to know exactly which shape is selected by user. How can I do it?

    For example get an index of Application.ActiveWindow.Selection.ShapeRange[1].GroupItems[index] or some other way to determine selected shape.

    P.S. I saw the topic How to detect shape selected within a group in PowerPoint C#/VBA?(can't put the hyperlink), but the answer isn't suitable for me.


    • Edited by Arkhunt Wednesday, September 16, 2015 9:33 AM clarification
    Wednesday, September 16, 2015 9:30 AM

Answers

  • I've found the solution. To detect selected shape within the group you need simply use 
    Microsoft.Office.Interop.PowerPoint ShapeInGroup = Application.ActiveWindow.Selection.ChildShapeRange[1];
    where ShapeInGroup is selected shape.
    • Marked as answer by Arkhunt Thursday, September 24, 2015 7:20 AM
    Thursday, September 24, 2015 7:20 AM

All replies

  • >>>For example get an index of Application.ActiveWindow.Selection.ShapeRange[1].GroupItems[index] or some other way to determine selected shape.

    According to my research, I could not see any workaround to overcome this.

    So I suggest that you could submit feedback to Office:

    Thursday, September 17, 2015 9:35 AM
  • Office 2013 seems doesn't contain any feedback ability. Any other suggestions?
    I thought this forum is for resolving issues in developing, and I didn't even expect the proposal to write office feedback
    Friday, September 18, 2015 12:30 PM
  • I've found the solution. To detect selected shape within the group you need simply use 
    Microsoft.Office.Interop.PowerPoint ShapeInGroup = Application.ActiveWindow.Selection.ChildShapeRange[1];
    where ShapeInGroup is selected shape.
    • Marked as answer by Arkhunt Thursday, September 24, 2015 7:20 AM
    Thursday, September 24, 2015 7:20 AM