I currently have a program in Visio that when a specific shape in my custom stencil is dragged onto the screen, a user form comes up and asks the user a question with a combo box used for the user to select an answer.
Based on the answer selected, the shape data should change for that object.
The problem that I am facing is that I am not sure how to target the ID of the shape automatically to then change its shape data. Since multiple of these shapes may be placed, I can not manually write a new piece of code for every ID.
Image: Shapesheet of the shape running the macro on drop. "Form" is the user form.
I would be very grateful if someone could help me with this problem.
Thank you
I wonder if the
CALLTHIS
ShapeSheet function might be more useful here as it passes a reference to the calling shape. So, for example, in theEventDrop
cell add this formula:and then add this backing code:
Note, that I've put the code in the
ThisDocument
class, but it can live in any accessable module. Also note the project name (Drawing001) which will likely be the file name without the extension.