Automatic text pop-up when shape/icon dragged onto worksheet

Started by deanos, March 06, 2012, 12:06:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

deanos

Hi All,

newbie here so be kind  ;D
If what I am after has already been answered / discussed pls point me to that discussion, also, pls excuse any misuse of terminology.

Basically, what I am looking to do is somehow edit a few icons/shapes so that when they are dragged and dropped they automatically pop-up a text box where my colleagues can fill in / use drop downs for the text boxes.

Thanks in advance

Deanos 

Jumpy

With Visio2003 or newer, you can create shapes, that can contain ShapeData. There is a nice window-form where you can fill out the Data. You can define if the data should be text, numerical, a date and if the user can enter the values manually or via dropdownbox.

To call this nice window-form on drop event, go to the ShapeSheet of the Shape. In the Event-Section go to the onDrop cell and enter the formula =DOCMD(1312).

Paul Herber

It also works just as well in previous versions of Visio, except that the data was called Custom Properties instead of Shape Data.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

deanos

Thanks guys. I have managed to edit the Event section on drop formula as recommended. But the real dumb question is how do I save the icon back into the stencil set? Because when I drag and drop it it's not providing an auto pop up window form as I would expect. Thanks again in advance, Deanos

Jumpy

1) Shape to stencil:
-Open stencil in edit mode
-delete old master shape
-drag modified shape to stencil as new mastershape
-save stencil
-close stencil edit mode

2) In your drwanig:
- Open the so called document stencil
- delete every instance of the old shape from the document stencil
- save the drawing

3)
When you now drag and drop a shape (based on the new mastershape) to the drawing, it should have the desired effect.

deanos


deanos

further questions;
is it possible to force a user to pre-populate certain fields before clicking OK or Cancel?
and is there a neat way to produce a word version/output of the diagram?

Thanks

Jumpy

If you use the Build-In dialog for ShapeData (via GUI or via DOCMD(1312) doesn't matter) you can't force the user to enter values. For this you need to create your own Windows-Form and write some custom VBA-Code.

And what do you mean by word version? Copy the diagramm to MS Word?
You could try embedding/linking with OLE.

hth Jumpy

deanos

apologies for the badly described question early.
I guess what I am asking is it possible to export the form data to word?

Re forcing the user to enter data into the attribute fields before entering OK/Cancel - I have to ask, would you be proficient enough to help put together a VBA script or know anyone who love to help out :D Worth a few beers to anyone if they are based in London  :D

Also, is there a way to create a drop down list in the attribute fields for the user to select from?

Cheers,

./D

Jumpy

Here is a recent thread from a user who populates a Windows-Form with ShapeData.
Maybe you can contact the user for an example. It's not a difficult thing to do, all the tools you need are in the VBA editor.

http://visguy.com/vgforum/index.php?topic=3987.0


To export the ShapeData to word, you'll have to write cusomizied code, too. Or you use the built in Reporting Tools, but afaik they can export only to Excel. If you want to do it the hard way, go to an Excel-Forum, search for a thread about automating word from excel. Úse the code that is used there as a starting point for your own code in Visio.

aledlund

you might check out the two referenced threads mentioned over here for excel and access round-tripping

http://visguy.com/vgforum/index.php?topic=3615.msg14112#msg14112

al

deanos

Thanks Aledlund and Jumpy.

Re Build-In dialog for ShapeData;
what's the syntax for creating a dropdown list in an attribute field?
can the dropdown list be linked to a db?