Siva Senthil
Siva Senthil

Reputation: 610

How to create a custom shape similar to Add Multiple Topics in brainstorm stencil of Visio 2016

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 -

  1. 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"

  1. Searched on the internet (Googled :) ) on how to achieve this with the same text as the title of this question.

[Observation] - I get results related to

  1. Adding custom properties
  2. Linking data to a shape
  3. How to effectively use Mind mapping features of Visio.

The ask

  1. How to engineer a custom shape which will fulfills the ambition?

Upvotes: 1

Views: 487

Answers (1)

y4cine
y4cine

Reputation: 394

What you will need is a stencil with

  • a module
  • a form
  • a master The master (the shape to drop) will have in its ondrop cell a formula calling a sub routine (eg sub CallForm), which itself calls the form. The formula in the ondrop cell would write: = CALLTHIS(“MyModule”, “CallForm”)

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

Related Questions