
Document/Stencil Objects/masters
Folks, I have a 'lack of understanding' that's causing me a problem.
I am trying to run a macro which:
Opens a blank document and creates a Visio.document object to reference it.
Creates a collection object to reference that document's masters collection.
Opens a stencil (using Openex) and 'add's a new, separate master object to
the masters collection object for each stencil master shape that I want to
use.
The understanding gap opens up when I want to include stencils from a second
stencil document.
I go through the same process of opening up the second stencil as a Visio
document, and then adding the stencil shapes as masters to the original
masters collection.
When I try to reference the masters from the first stencil (as master
objects by name), then the references are gone. It appears that opening the
second stencil has somehow lost the contents of the original documents
masters collection.
I need to set up this pool of shape objects and pick from them in a for/next
loop, the only solution I have come up with is to set up the masters
collection each time I need a shape, hardly efficient code!
I don't understand why I cant add masters from the stencil document into the
target documents masters collection?
Failing all else , I think I will have to copy the shapes I need from each
stencil in turn, then reference them by name within the current document.
Any ideas/alternatives?
Thanks in advance, Dave Eagle.