vba - Get shape Id by Name -


Is there a way to get the shape of the id if you know it's Is the name ?

For example, if I have this:

  dim myshape size myshape.Name   

Do I get it Can ID ?

  myshape.id = getIdByName (myshape.Name)    

Sure, it's pretty fast:

  subprintSpidId () debug Print IDBInam ("My Size", 1) End Sub Function getIDByName (shapeName as Slide in the form of the slide, Slide as integer) Set the dim ap as presentation: AP = Active rendering as SL Slide Slide Set: SL = AP Slides (Slide) Dim sh Shape: Set sh = sl.Shapes (shapeName) getIDByName = sh.Id End Function   

This works for the slide you specify. You can also loop through all the slides, but note that there can be more than one shape with the same name, so you have to find out who you want.

Comments