Visio 2007: Setting Shape or Connector Position From Excel

C

Cam

In the Visio 2007 Environment, is it possible to specify the X and Y position
that a Shape will attach to from an Excel database - so that when the shape
is dragged from the External Data window onto the Visio page, it
automatically attachs to the coordinates specified in the spreadsheet?
Similary, is it possible to specify the locations of one or both ends of a
connector in the same way? If so, can other Shape/Connector attributes be set
in the same way?

Many Thanks In Advance
Cam
 
J

J Kallay

It depends on whether you want this to occur for ANY shape that is linked to
a data row by being dragged from the external data window, or specific
custom masters. If you want to do it for any shape, you will need some code
that responds to data linking or shape dropping events. If for your own
specific masters, add the appropriate Shape Data fields to the master
(probably Prop._VisDM_X and Prop._VisDM_Y) and then put the following in the
master's EventDrop cell:
SETF(GetRef(PinX),Prop._VisDM_X)+SETF(GetRef(PinY),Prop._VisDM_Y)

This will set the PinX and PinY cells to the contents of the Shape Data
fields when an instance is dropped on the page (fortunately Data Link
populates those fields before the drop event fires).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top