Document/Stencil Objects/masters 
Author Message
 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.



Sat, 18 Jun 2005 23:10:49 GMT  
 Document/Stencil Objects/masters
Can you post an example of what you are doing?

The various stencils and drawings should be accessible through the documents
collection. You may be repeatedly reassigning a document to the same object.

John...    Visio MVP

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples?   http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm

Quote:
> 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.



Sun, 19 Jun 2005 21:43:59 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Deleting Masters in Document Stencil

2. Standalone Stencil and Document Stencil

3. Can I update master shapes in Document Stencil from another stencil?

4. Visio masters appearance on stencil

5. Disabling a Master in Stencil window

6. How to update document master shapes from template master shapes

7. Getting Master from Closed Stencil

8. Getting the selected master from Stencil?

9. Updating Documents Created From a Master Document Template

10. open stencil IN a Visio document

11. How to get reference of Document Stencil

12. Vba code in stencils problem( duplicate stencils)

 

 
Powered by phpBB® Forum Software