Thumbnail images, macro warnings, PreviewPicture

F

fss

I have created several Visio drawing templates (.vst) which display with thumbnail images in the “Choose File Type…†window. These images are metafile (.emf) format and are selected in the PreviewPicture property in the VBA editor.

There are two problems I am having

1. Every time I make changes to the templates, I have to reselect the PreviewPicture property in the ThisDocument properties window before saving the template or the thumbnail will be blank the next time the “Choose File Type…†window is opened. Visio doesn’t seem to remember the image file when the template is reopened and resaved.

2. The more serious problem is that in order to select the PreviewPicture property, VBA and VBA project creation must be enabled. It appears that just having a VBA project in the templates flags the templates as containing untrusted code, even though no code modules have been added. I have tried setting the property, disabling VBA, and then saving, but this does not remove the macro warning. I have chopped out the VBA project by saving the templates in XML format (.vtx), editing the text, and then retrieving the XML file in Visio and resaving it as a .vst file. This works to remove the VBA project, but the image is missing again because the XML file had to be opened and saved in Visio without reselecting the PreviewPicture property. My best alternative so far is to sign the project in each template to get rid of the macro warning. This works, but it doesn’t make sense to sign a project that doesn’t contain any code

Please help me break me out of this endless loop
 
R

Russ McKenna

Ditto -

my work around was to save my document as a VSX - open it in notepad -
delete the VBA code at the end, save it. Load Visio, file -> open VSX and
choose document shapesheet - set lockpreview to true. Save document as VST.
Trust me, before the last visio update, setting the preview to a file
without the macro warning was easy.




fss said:
I have created several Visio drawing templates (.vst) which display with
thumbnail images in the "Choose File Type." window. These images are
metafile (.emf) format and are selected in the PreviewPicture property in
the VBA editor.
There are two problems I am having:

1. Every time I make changes to the templates, I have to reselect the
PreviewPicture property in the ThisDocument properties window before saving
the template or the thumbnail will be blank the next time the "Choose File
Type." window is opened. Visio doesn't seem to remember the image file when
the template is reopened and resaved.
2. The more serious problem is that in order to select the PreviewPicture
property, VBA and VBA project creation must be enabled. It appears that
just having a VBA project in the templates flags the templates as containing
untrusted code, even though no code modules have been added. I have tried
setting the property, disabling VBA, and then saving, but this does not
remove the macro warning. I have chopped out the VBA project by saving the
templates in XML format (.vtx), editing the text, and then retrieving the
XML file in Visio and resaving it as a .vst file. This works to remove the
VBA project, but the image is missing again because the XML file had to be
opened and saved in Visio without reselecting the PreviewPicture property.
My best alternative so far is to sign the project in each template to get
rid of the macro warning. This works, but it doesn't make sense to sign a
project that doesn't contain any code.
 
J

John Marshall, MVP

Check the Document Properties box, for a cell marked LockPreview.

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
fss said:
I have created several Visio drawing templates (.vst) which display with
thumbnail images in the "Choose File Type." window. These images are
metafile (.emf) format and are selected in the PreviewPicture property in
the VBA editor.
There are two problems I am having:

1. Every time I make changes to the templates, I have to reselect the
PreviewPicture property in the ThisDocument properties window before saving
the template or the thumbnail will be blank the next time the "Choose File
Type." window is opened. Visio doesn't seem to remember the image file when
the template is reopened and resaved.
2. The more serious problem is that in order to select the PreviewPicture
property, VBA and VBA project creation must be enabled. It appears that
just having a VBA project in the templates flags the templates as containing
untrusted code, even though no code modules have been added. I have tried
setting the property, disabling VBA, and then saving, but this does not
remove the macro warning. I have chopped out the VBA project by saving the
templates in XML format (.vtx), editing the text, and then retrieving the
XML file in Visio and resaving it as a .vst file. This works to remove the
VBA project, but the image is missing again because the XML file had to be
opened and saved in Visio without reselecting the PreviewPicture property.
My best alternative so far is to sign the project in each template to get
rid of the macro warning. This works, but it doesn't make sense to sign a
project that doesn't contain any code.
 

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