Reputation: 610
Background
I have to many a times draw multiple rectangles in Visio. I noticed the Brainstorming template's stencil in Visio has a shape named "Add Multiple Topics". When you bring this shape to document's page it prompts you with a input to enter topic names separated by newline characters. When you provide this depending on the number of lines topics (Horizontal lines) with provided texts are added to the document's page.
Ambition
Create a similar (to Add Multiple Topics) custom shape in Visio with rectangles. i.e. I want to have a shape named "Add multiple components" when dropped on a document sheet it should prompt for the names of components which are expected to be separated by new line characters. When those names are provided those many rectangles with text provided should be added to Visio document.
So far
I have explored the following avenue -
I opened the stencil from which I inspired in Visio and inspected for
a) Macro code which might generate additional shapes when you drop the shape in a document's page.
[Observation] - No macro code was written in the stencil.
b) In-built function in the shape sheet which gets called on the Event of EventDrop
or EventMultiDrop
.
[Observation] - The cells carried text "No Formula"
[Observation] - I get results related to
- Adding custom properties
- Linking data to a shape
- How to effectively use Mind mapping features of Visio.
The ask
Upvotes: 1
Views: 487
Reputation: 394
What you will need is a stencil with
Sub CallForm(shp as shape) Shp.delete ‘the shape is not need anymore myForm.show end sub
In the form you’ll have two text boxes: for the master to use and for the list of entries. A button could then trigger the command: ActivePage.Drop Application.Documents.Item([AnyStencil]).Masters.ItemU([TheChosenMaster]), 1,1 To drop the desired master at position 1,1.
Upvotes: 1