I've managed to programatically insert a shape into Visio using the code below:
ActiveWindow.Page.Drop(VisioApp.Documents["ORGCH_M.VSS"].Masters.ItemU["Executive"], 5.433071, 7.559055);
How would i programatically retrieve it's X,Y coordinates after the shape has been inserted?
Thanks!
To get the coordinates of the new shape first get a reference to the new shape. Page.Drop will retun this reference. Then look in that shape object for its PinX and PinY cells. This will give you the coordinates in Visio's default units i.e. inches. Here is an example in VBA:
I notice you are working in a metric drawing (i.e. _M in the filename). You may prefer to work in a different unit. Here is the same example using millimeters: