Selecting shape by shapeid VBA powerpoint

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Selecting shape by shapeid VBA powerpoint



I want to select a Shape by shapeid. My assumption from reading is that shape id is unique, the shape index seems to change with any change to file so I want the ID. Each search I make yields examples where people say that you should not bother to do this, but no explanation of how one would do it.



The best I found was someone who did a loop through the whole index to find which index number matched a specific ID. That seems terribly inefficient. I want to find shape ids of specific shapes that users will interact with on a touchscreen. Major apologies for any confusion I am typing this on phone. The example code obviously doesn't work since the index and Id do not match. It was just written to return ids of the shapes I touched and when they did not match index I added glow to see which shape in index it was.



Is my only option to run a loop of all shapes in index to see if I'd matched? Any short cut would be greatly appreciated.


Sub test(tshp)
Msgbox(tshp.Id)
ActivePresentation.SlideShowWindow._
View.Slide.Shapes(tshp.Id).glow._
radius =20

ActivePresentation.SlideShowWindow._
View.Slide.Shapes(tshp.Id).glow._
color=rgb(255.0.0)

End sub





Why not refer to shapes by shape names? They are unique too, and you can refer to them directly, and can make a lot more sense if you customize them appropriately... (and can even end with a unique number if you like!) More info: MSDN: Shape.Name Property
– ashleedawg
Aug 6 at 2:55



Shape.Name





I have read that shape names are not unique. They can be duplicates from what I read. If that is inaccurate then yes shape names would be much easier to deal with. From what I read names are only unique to a slide not a presentation. I suppose I could name everything manually, that seems tedious though.
– sxotty
Aug 6 at 3:07










By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard