UserForm on Shape drag-n-drop

K

Krzysztof

Hi,

I need some help on finding a place where I can specify that a UserForm I created,
is displayed each time the specified shape is dragged-n-dropped on the page. I have
created a UserForm and VBA script managing that Form but I can't find anywhere an
option which tells the form to popup on drop. TIA.

Krzysztof
 
D

Denis Zavadil

Add an entry in the Shapes "EventDblClick" Shape Sheet Cell Such as:

CALLTHIS("ThisDocument.ShowTheForm")

Where "ShowTheForm" is a Sub Routine in the Document Object which loads the
required form.

dz
 
G

GMorris

There's an event 'EventDrop' that fires only when you drop the object on the
page,
and there's 'EventFXMod' that fires when you drop it AND every time you move
or resize it. The last one can be a pain, but it's pretty handy sometimes.
As a test,
try something like: =RUNADDON("MsgBox ""Hello""") in the cells and then drop
and move/resize to see how they work.
 
K

Krzysztof

I can't make it work. I have a stencil with my shapes, I do "Edit Stencil", then I
double-click on certain shape (jump into edit mode), then I choose Show ShapeSheet
and I put the code into Events section in EventDrop. Then I save the changes, open
a new visio page, I drag'n'drop the shape on the page and nothing happens. Any
ideas why? TIA.

Krzysztof
 
G

GMorris

Are you getting any error messages, or does it just not do anything?
That's kind of curious..

I would say try EventFXMod with the same formula and see if that works.
Visio is picky about shapes vs. masters, and sometimes it's not so obvious
what the problem is.
 
K

Krzysztof

I found out what the problem was. I created all forms and vba scripts within the
stencil project and not the template page project. None of the actions could be
applied to newly created page as they belonged to stencil itself. After I copied
everything from stencil to the page, all events worked fine.

Krzysztof
 

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