Complex logic for custom masters

T

Tiret Ohf D.

Hi everybody,

I tried to create a set of masters (stencil) that would support a
complex logic, like Visio UML stencils do. The problem is the stencil
should work without any support of corresponding Visio addon (there is
not addon at all), i.e., all the shapes' functionaly must be contained
in the shapes itself. For example, I need to track if user is
attempting to connect one shape to another and warn him if such the
connection is illegal. I know how to do it with Visio addon (addin?):
it just the utilizing of Visio object model + events. But how to
encapsulate the functionality into shapes? Any clues?

Thanks.
--T.
 
T

Tiret Ohf D.

John,

I am using ShapeStudio. How can I link the code you're talking about to
stencil? I'll be just happy to use code (real code, even if it's VBA)
but all that I observe is DOCMD, INT, ANG and other mysterious stuff in
shapesheets.

Regards,
--T.
 
T

Tiret Ohf D.

Thank you John. That's what I needed. It's strange that I saw the
article earlier but overlooked it.

Thanks again.

--T.
 
T

Tiret Ohf D.

But wait. I remembered why I skipped the article earlier: RUNADDON
doesn't work with Visio2003 the way I need: now I can't simply write:
Action=RUNADDON("MsgBox123") in cell; That is I can but Visio won't
show the message box. It ignores vba code in RUNADDON arguments.

Maybe you know other ways of embedding vba code into master/stencil?

--T.
 
J

John Marshall, MVP

I had forgotten that some of the functions had been cut back. The following
article discuss this and mentions that CallThis can be used instead.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvisio02/html/vis_runadd.asp


John... Visio MVP

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples? http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm
Visio Wishlist http://www.mvps.org/visio/wish_list.htm
 
T

Tiret Ohf D.

John, thank you for the link. This is how I can call code. But I asked
for information on how I can write document-independent code and put it
into my stencil. Am I right that all macros are document-specific and
cannot be included into stencil?

--T.
 
J

John Marshall, MVP

Visio only has one file format. How Visio treats a file is dependant on the
extension. So yes, you can store macros in a stencil.

The easiest way is to create the drawing with the code and the shapes as a
drawing and then change the file extension from vsd to vss. Once created,
you can continue editing it as a stencil. Since the stencil contains code,
it will appear in the explorer window in the VBA UI.

John... Visio MVP

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples? http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm
Visio Wishlist http://www.mvps.org/visio/wish_list.htm
 

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