selected item in a group in powerpoint

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to change color properties of a selected item in a group. Having
difficulty identifying in vba which item is selected. All the code I've seen
goes by a certain type of an item, but that is not helpful when you have 30
items of the same type and only one of then needs to be changed.

Any ideas? Thank you ahead of time!
 
Be easier if we could see your code

I guess you know how to name items before you group using vba so do that

Them something like (air code not tested!)

Dim ogp as shape
For Each ogp In ActiveWindow.Selection.ShapeRange.GroupItems
If ogrp.name=*** Then
do whatever
End if
Next

--

Did that answer the question / help?
_____________________________
John Wilson
Microsoft Certified Office Specialist
http://www.technologytrish.co.uk/ppttipshome.html
 
Naming items in a group in my case is not an option.

Here is part of the code, but I can't identify a selected cell.

Case msoGroup
' If it's a group them iterate thru the items and list them
For Ctr = 1 To .GroupItems.Count
'The next condition needs to identify the item that has the
cursor or
' is selected otherwise.
If .GroupItems(Ctr) ??????? Then
.GroupItems(Ctr).Fill.ForeColor.RGB = RGB(0, 0, 0)
End If
Next Ctr
 
Shyam, thank you! So simple!
Your code made available elsewhere has been a great help to me in trying to
get a measure of control over PowerPoint.
Thank you very much again!
 
Shyam,
Your code works only if the whole object in a group is selected. However, if
the cursor is inside that object, HasChildShapeRange condition is not met.
Why is that? And more importantly, what to do in this case? Thank you.
 
Staroslav said:
Shyam,
Your code works only if the whole object in a group is selected. However, if
the cursor is inside that object, HasChildShapeRange condition is not met.
Why is that? And more importantly, what to do in this case? Thank you.

If ActiveWindow.Selection.Type = ppSelectionText Then
' the cursor is in a text frame/text is selected
Debug.Print ActiveWindow.Selection.TextRange.Parent.Parent.Name
End If
 
Back
Top