Visio 2003 - How to select one master in stencil...

Started by Rablam, August 22, 2011, 02:40:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rablam

Hi everyone,

Is it possible to select one (or several, but not all) masters in a stencils through VBA? I mean I just want to select it, just like clicking on it, no drop, no other special operation for the moment.
I manage to use something like mywindow.selectall or deselectall, I can use mywindow.selectedMasters to get the list of masters selected in the stencil, but I can't figure out how to select just one master...

Thanks for your help.

Rablam.

JuneTheSecond

#1
I cannot find out any Visio method to select masters in shape window.
I think you can select masters by simulating mouse moving and clicking using windows api.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

Nikolay

#2
Although it cannot be done directly (at least it seems nobody figured out how to do it yet), you could try to accomplish that by emulating user actions just like Junichi wrote.
I think you could also avoid WIN API if you "select" with keyboard and not with the mouse. Also keyboard might be helpful to avoid "View mode" or other positioning problems.

Take a look at the attached example. It uses SendKeys built-in VBA method to send {LEFT} and {RIGHT} keys.
(run the macro named "SelectMasterByName" it will prompt for master to select)

Rablam

Hi,

Thanks a lot, the example given by Nikolay is great. It did the job.

Rablam.