Picture on Templates

A

Alan

I have created a template for use with my C# Add-In, and would like to have a
picture representing the diagram shown in the "Choose Drawing Type" window
that opens with Visio, rather than a blank white box...

Any suggestions?

Thanks
 
C

Chris Roth [ Visio MVP ]

It's slightly obscure, but not hard once you figure it out.

The Document has a PreviewPicture property. You need to set that.

I believe the preview picture gets wiped, every time you mess with your
drawing.

SOOOO

Check out the dev help for PreviewPicture. The Visio 2003 SDK might have a
utility, but I can't remember. If not, you need to write about 6 lines of
code to copy the PreviewPicture from document A to document B, where:

B is the template you ship with the solution. It is blank, but has a cool
preview picture.
A is a dummy drawing you keep that has a the actual "cool drawing.

Ie: make a cool drawing in A. When you save, A will have the stunning
PreviewPicture, which you copy to B every time you muck with B.

--

Hope this helps,

Chris Roth
Visio MVP
 
D

David Parker

You can change the LockPreview cell of the Document to TRUE after you have
copied the pretty picture for the first time.
This will be better than pasting it back each time...
 
J

John Marshall, MVP

In the master copy of your template, include the drawing you would like to
use for the preview drawing. Make sure that "Save Preview Picture" on the
Summary Tab of the Properties dialog from the File menu is marked.

When you are ready to release a copy of your template, make a copy and
uncheck the "Save Preview Picture". The sample drawing can then be deleted
from the copy of the template and resaved without affecting the preview
picture.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top