function/method to display/hide the Custom Properties Window

J

Joe Mako

I would like to be able to double-click a shape and have it open the Custom
Properties for that shape.

I understand that I can right-click on the shape and select Format ->
Behavior and then the tab Double-Click to assign a macro.

Is it possible to create a macro that will display the shape's Custom
Properties?

Is there a function/method to display/hide the Custom Properties Window?
 
A

Al Edlund

joe,
the short answer is yes you can open the custom property dialog with a
double-click. the easy way is to put a DOCMD into the action field in the
spreadsheet. I don't know the command id, but will get back to it later
today. You should be able to get it from the visio help files.
al
 
J

Joe Mako

Thank you for pointing out the DOCMD to me. Whith that info, I was able to
find: http://msdn2.microsoft.com/en-us/library/aa342178.aspx

In the ShapeSheet, the Events section, and in the cell for EventDblClick, I
entered
DOCMD(1658)

When I double-clicked the shape, nothing happened, I tried some other
numbers, and nothing would happen.

What am I missing?
 
J

Joe Mako

Well, I saw that in my last post, the link has a column for ShapeSheet that
says NO to the command that I want to use in the ShapeSheet. So I went
looking for other ways to call "Application.DoCmd (visCmdCustProp)" from the
ShapeSheet.

I found:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarvisio/html/attachcode.asp
that explained how to use the RUNADDON function with inline VBA

then I found:
http://msdn2.microsoft.com/en-us/library/aa140368(office.10).aspx
that says inline VBA in the ShapeSheet has been disabled

So I think I will have to use something like:
RUNMACRO("Drawing1.DisplayCustProp.DisplayCustProp")

If I were to add this to the shapeSheet of a shape in a stencil, and use it
in another drawing, I get the following error:
System Error &H80004055 (-2147467259). Unspecified error

I fully expected to get an error because the "Drawing1" referenced in the
cell is no longer open.

Is it possible to put this VBA code inside of a shape without having to
create a module in the document?
 
A

Al Edlund

as you discovered, code in a shape sheet has gone the way of the dodo bird.
It was declared a security risk. glad to hear you found the command you
needed.
al
 
V

vojo

docmd(1312) in double clikc cell
you can use functions in shape sheet to show/hide individual custom property
elements (poor mans context sensitive custom properties presentation).
Ie...if X=1, show these custom properties when double click...if x=2, show
those custom properties when double clicked
 

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