Template Icons

S

Super Secret

Is it possible to change the icons for templates displayed on the Task
Pane? I'll take manual or programmatic. I've only got a couple.

Thank you
 
C

Chris Roth [MVP]

Hi SS,

To change the preview on a template, you set the Document.PreviewPicture
property. For content you create yourself, you have to use the
SolutionPublishing tool to edit an install file that "registers" the
template correctly with Visio. This is available in the Visio SDK.

But the Visio templates are already installed, so you can edit their preview
pictures. In Visio 2007, the built-in templates seem to store a separate
preview picture somewhere else, though - they aren't using the document's
actual preview picture, they have some sort of built-in resource that I
don't think we can edit.

It might work for Visio 2003, however. I didn't try it.

The general way to do this is to create a document with a finished drawing,
and save it. We'll call this "doc1". When you save the document, Visio
generates a preview picture of the content in the active page. You can then
apply this preview to a document that has no content on it's pages using
automation. "Doc2" would then be your empty template, to which you want to
apply the preview:

Dim visDoc1 as Visio.Document
Dim visDoc2 as Visio.Document

Set visDoc1 as Visio.Documents(1)
Set visDoc2 as Visio.Documents(2)

Set visDoc2.PreviewPicture = visDoc1.PreviewPicture

You can check if it worked by selecting doc 2 in an Explorer window and
looking at the "Details" on the left.


--
Hope this helps,

Chris Roth
Visio MVP

Free Visio shapes:
http://www.visguy.com/category/shapes
Visio programming info:
http://www.visguy.com/category/programming/
Other Visio resources:
http://www.visguy.com/visio-links/
 
A

Al Edlund

change them to what? The 'icons' that visio presents are stored in the
document as emf. They can be grabbed using picturepreview method.
al
 
D

David Parker

....and don't forget to lock the preview of doc 2 before saving it!
Open the ShapeSheet for the document from the right mouse menu of the
Drawing Explorer Window, then change LockPreview = True
 
S

Super Secret

Thank you. After fiddling around with it for a couple of hours I got
it to work. And I learned something new about publishing vice just
pushing the template to the solutions directory (my company currently
uses Visio 2002, but we are on the verge of losing all of our licenses
forcing the upgrade to Visio 2007).

It appears this group will be vital to me.

Thanks again!
 

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