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/