Selecting a Master shape to drop
A Master object must be obtained before it can be dropped onto a page using code. Simply knowing the name of a desired Master is not enough because the Master may not exist in the Document Stencil yet. Also, there may be more than one Master with the same name on any opened stencil, so the stencil name may also be required. In fact, the active Document may have a number of docked stencils, so they should be checked first. Then, the Visio Application may have a number of different stencil documents open. Lastly, the stencil may not even be open in Visio, so the stencil may need to be opened, but that is left for the accompanying code for this book.
The caption that appears on the header bar of a stencil is either the mapped long name or title of the stencil, if there is one, otherwise it displays the name without the file extension. All the built-in stencils have terse filenames that are mapped to longer names that are displayed in the UI. These mappings are...