Deleting Masters in Document Stencil 
Author Message
 Deleting Masters in Document Stencil

Using VBA what code do I need to put in the "BeforeDocumentSave" procedure
of Visio to delete all Masters in the Document Stencil?



Sat, 22 Mar 2003 03:00:00 GMT  
 Deleting Masters in Document Stencil

Richard:

Quote:
> Using VBA what code do I need to put in the "BeforeDocumentSave" procedure
> of Visio to delete all Masters in the Document Stencil?

You would need to iterate through the Document.Masters collection and
delete each master. But are you sure you want to do this?  Is it OK for
the shapes on your drawing to lose their inheritance?

Graham

--------------------------------------------
Graham Wideman
MS MVP for Visio
Book: Visio 2000 Developer's Survival Guide
... and resources for programmable diagramming at:
http://www.diagramantics.com
--------------------------------------------
Unoffical Visio FAQ:
http://www.diagramantics.com/diagenvs/visio/faq/index.htm

(Remove the obvious to email me)
---------------------------------------------



Sun, 23 Mar 2003 03:00:00 GMT  
 Deleting Masters in Document Stencil

We've been doing this manually for quite awhile with no apparent problems.
Our drawings are quite detailed and can be 3 to 4 Megs each. When we delete
the Document masters the file size goes as small as 1/3 to 1/4 the original
size. This is great as we do alot of E-Mailing of these files.

What exactly do we lose with the inheritance?



Quote:
> Richard:

> > Using VBA what code do I need to put in the "BeforeDocumentSave"
procedure
> > of Visio to delete all Masters in the Document Stencil?

> You would need to iterate through the Document.Masters collection and
> delete each master. But are you sure you want to do this?  Is it OK for
> the shapes on your drawing to lose their inheritance?

> Graham

> --------------------------------------------
> Graham Wideman
> MS MVP for Visio
> Book: Visio 2000 Developer's Survival Guide
> ... and resources for programmable diagramming at:
> http://www.diagramantics.com
> --------------------------------------------
> Unoffical Visio FAQ:
> http://www.diagramantics.com/diagenvs/visio/faq/index.htm

> (Remove the obvious to email me)
> ---------------------------------------------



Sun, 23 Mar 2003 03:00:00 GMT  
 Deleting Masters in Document Stencil

The ability to propagate changes, but if these copies of the drawings are
not to be updated then it is not a problem.

John ....                Visio MVP

(Only responses to the newsgroups will be answered)


Quote:
> We've been doing this manually for quite awhile with no apparent problems.
> Our drawings are quite detailed and can be 3 to 4 Megs each. When we
delete
> the Document masters the file size goes as small as 1/3 to 1/4 the
original
> size. This is great as we do alot of E-Mailing of these files.

> What exactly do we lose with the inheritance?



> > Richard:

> > > Using VBA what code do I need to put in the "BeforeDocumentSave"
> procedure
> > > of Visio to delete all Masters in the Document Stencil?

> > You would need to iterate through the Document.Masters collection and
> > delete each master. But are you sure you want to do this?  Is it OK for
> > the shapes on your drawing to lose their inheritance?

> > Graham

> > --------------------------------------------
> > Graham Wideman
> > MS MVP for Visio
> > Book: Visio 2000 Developer's Survival Guide
> > ... and resources for programmable diagramming at:
> > http://www.diagramantics.com
> > --------------------------------------------
> > Unoffical Visio FAQ:
> > http://www.diagramantics.com/diagenvs/visio/faq/index.htm

> > (Remove the obvious to email me)
> > ---------------------------------------------



Mon, 24 Mar 2003 03:00:00 GMT  
 Deleting Masters in Document Stencil

Richard --

Quote:

> We've been doing this manually for quite awhile with no apparent problems.
> Our drawings are quite detailed and can be 3 to 4 Megs each. When we delete
> the Document masters the file size goes as small as 1/3 to 1/4 the original
> size. This is great as we do alot of E-Mailing of these files.

That's an interesting puzzle! In theory, when you delete a master from
local masters, that forces all shapes on the drawing to have their own
copy of the data. So what you save in bytes by deleting the master you
lose by needing to store copies of those bytes in each of the decendant
shapes.

So you would certainly save by deleting masters that are not refered to
by any drawing shapes, such as shapes that you dropped at one time, but
then decided to delete, leaving no shapes of that type for that master.

But if this is not the source of the saving, this is a puzzle. I'm
guessing that a master has a few more bytes than a shape (since a Master
actually has similar structure to a Page + Shape(s)), but it's hard to
explain a 1/3 or 1/4 file size!

Graham

--------------------------------------------
Graham Wideman
MS MVP for Visio
Book: Visio 2000 Developer's Survival Guide
... and resources for programmable diagramming at:
http://www.diagramantics.com
--------------------------------------------
Unoffical Visio FAQ:
http://www.diagramantics.com/diagenvs/visio/faq/index.htm

(Remove the obvious to email me)
---------------------------------------------



Tue, 25 Mar 2003 03:00:00 GMT  
 Deleting Masters in Document Stencil
Well 1/3 to 1/4 the original size might be pushing it. I just did the
following test:

I created a new drawing and added 2 of my largest shapes and saved the file.
It was 1,721,344 bytes. Opened the file and deleted the 2 master from the
document stencil and resaved. The file size is now 765,952 Bytes. That's
somewhere between 1/2 and 1/3. That's up to five minutes of downloading when
attached to an E-mail using dial-up.

Further I changed the pre-vu to draft and the file size became 734,720
bytes.

Anybody have any other ideas on how to further reduce the file size. The
smaller the better.

Richard



Quote:
> Richard --


> > We've been doing this manually for quite awhile with no apparent
problems.
> > Our drawings are quite detailed and can be 3 to 4 Megs each. When we
delete
> > the Document masters the file size goes as small as 1/3 to 1/4 the
original
> > size. This is great as we do alot of E-Mailing of these files.

> That's an interesting puzzle! In theory, when you delete a master from
> local masters, that forces all shapes on the drawing to have their own
> copy of the data. So what you save in bytes by deleting the master you
> lose by needing to store copies of those bytes in each of the decendant
> shapes.

> So you would certainly save by deleting masters that are not refered to
> by any drawing shapes, such as shapes that you dropped at one time, but
> then decided to delete, leaving no shapes of that type for that master.

> But if this is not the source of the saving, this is a puzzle. I'm
> guessing that a master has a few more bytes than a shape (since a Master
> actually has similar structure to a Page + Shape(s)), but it's hard to
> explain a 1/3 or 1/4 file size!

> Graham

> --------------------------------------------
> Graham Wideman
> MS MVP for Visio
> Book: Visio 2000 Developer's Survival Guide
> ... and resources for programmable diagramming at:
> http://www.diagramantics.com
> --------------------------------------------
> Unoffical Visio FAQ:
> http://www.diagramantics.com/diagenvs/visio/faq/index.htm

> (Remove the obvious to email me)
> ---------------------------------------------



Wed, 26 Mar 2003 03:00:00 GMT  
 Deleting Masters in Document Stencil

Richard:

1.7 Meg! Holy cow, what do have in them thar shapes? Seriously, would
you care to describe what kind of shapes these are? Are you using
images? Huge amounts of text? Large embedded OLE objects? Or are they
just incredibly elaborate?

Graham
--------------------------------------------
Graham Wideman
MS MVP for Visio
Book: Visio 2000 Developer's Survival Guide
... and resources for programmable diagramming at:
http://www.diagramantics.com
--------------------------------------------
Unoffical Visio FAQ:
http://www.diagramantics.com/diagenvs/visio/faq/index.htm

(Remove the obvious to email me)
---------------------------------------------



Wed, 26 Mar 2003 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Document/Stencil Objects/masters

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