Using VBA to Prompt User to Select Shapes

Started by metuemre, December 27, 2016, 07:55:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

metuemre

I'm working on a macro that will get multiple "From Shape" and a single "To Shape" and automatically connect predefined connection points of "From Shapes" to "To Shape".

In order to do that I was thinking of using a method similar to Application.InputBox method of Excel VBA or RefEdit control in a Userform which lets user to pause the macro and select a Range and continue macro with selected range.
https://msdn.microsoft.com/en-us/library/office/ff839468.aspx

In my example user will be prompted to select multiple "From Shapes" and prompted again to select "To Shape" and then macro will do the rest.

My question is that is there any method in Visio VBA to do this?

wapperdude

Visio 2019 Pro

Nikolay

Probably what you actually want is a "modeless" VBA form.  To do that you can specify vbModelss. Like this:

UserForm1.Show vbModeless

"Modelss" forms are visible all the time (until you hide them explicitly),
and at the same time they allow user to interact with the drawing (i.e. they are not modal, but yep, modeless)

metuemre

Modeless userform was exactly what I needed, thanks Nikolay for the tip.

wapperdude

I forgot to mention that the example in the link I provided uses smokeless form.  Loops

Wapperdude
Visio 2019 Pro