Template / Drawing Reference Problem

T

Troy

I'm trying to develop a Visio VBA solution where the code resides in a
stencil that opens with a new drawing.

I currently have everything setup so that when the stencil loads it
adds to the existing menu structure and creates links to macros within
the stencil. The template is referenced to the stencil so the macros
are visible. When I open the template (not a new drawing) this works
flawlessly. I can see and use the menu structure and everything runs.

When I open a new drawing based on the template the drawing has the
menu structure I have added, but the menu items are grayed out. No
error messages or any indication of why this should be. When I look
in the Toos > Macros > [MyStencil] > [module] > subname I find the
macros. They work from this menu.

I know there are a lot of smart people out there, I'm sure someone has
done this before. Any help would be greatly appreciated.

Thank you,

Troy
 
P

Paul Herber

I'm trying to develop a Visio VBA solution where the code resides in a
stencil that opens with a new drawing.

I think you might need to put the code into the template. (I'm no
expert on this particular aspect).
 
J

JuneTheSecond

I7ve tested it with menu by UIobject .
If you succeeded in the template, then you will succeed in a created new
drawing.
Please confirm.
The stencil is correctly refered by template, the folder is also correct.
The reference to macro on stencil is refered like,
vsoMenuItem.AddOnName = "YourStencil.Module1.MyMacro"
ThisDocument.SetCustomMenus vsoUI is changed into
ActiveDocument.SetCustomMenus vsoUI .
 
J

JuneTheSecond

I woul like to add something.
The template should have at least a line of macro so that the reference to
the stencil can be saved.
The stencil that has macro for menu can not be deleted, while the refernece
from template is alive.
If you wish to make thestencil to enter edit mode, you should release the
reference before swiching to the edit mode. The reference should be restored
after swiching into edit mode.
You might feel it not convenient nor confortable.
 

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