How do I bring up custom properties window through macro?

M

Mikhail

I need to write a macro that will be called by a doubleclick event on a shape
that will open up a shape's custom properties window, and after OK is clicked
it does a database refresh/update.

I figured out how to refresh and update, but can not figure out how to make
the macro pop up a "Custom Properties" window (and wait for the user to click
OK before proceeding).

Custom properties can be called via a right click on the shape or through
the menu on under Shape --> Custom Properties.

Thanks.
 
A

Al Edlund

a little bit of insight might help. Custom properties is a window (as you
stated) with a window type of 1658. You can verify this by opening VBA,
select View Object Browser and then scroll down to visWinTypes and you will
find visWinIDCustProp.

this is the call to make it visible

Application.ActiveWindow.Windows.ItemFromID(visWinIDCustProp).Visible =
True

al
 
M

Mikhail

Thanks a lot, that got the Custom Properties window open.. the remaiting
problem is that I need the macro to do a database update and refresh /after/
the user closes the Custom Properties window. Our thought was to open the
other Custom Properties window (that is the one that comes up when you right
click on a shape and go to shape-->custom properties), and that would cause
the VB script to wait until the user clicked OK...

Is that possible?

Thanks again.
 
A

Al Edlund

did you use the database wizard to link the custom properties to the
database? If so you might consider select tools => addons => visio extras
=> link to database => advanced.
this gives you the option to automate what happens when a shape changes and
how it is reflected in the database.
al
 
M

Mikhail

Yeah, that's exactly what I used..
link to database-->advanced doesn't seem to let me automate anything.. it
just allows for certain actions (such as refresh, etc)..

I need it to refresh after the user edits the properties, ie closes the edit
custom properties window or hits OK.

Any ideas?

Thanks again
 
M

Mikhail

Found a workaround for this, thanks.

Mikhail said:
Yeah, that's exactly what I used..
link to database-->advanced doesn't seem to let me automate anything.. it
just allows for certain actions (such as refresh, etc)..

I need it to refresh after the user edits the properties, ie closes the edit
custom properties window or hits OK.

Any ideas?

Thanks again
 

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