PreviewPicture property

PreviewPicture property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

See also         Example         Applies to

Gets or sets the preview picture shown in the Open or Choose Drawing Type dialog box.

Version added

2002

Syntax

        
          objRet = object.PreviewPicture
      
        
          object
          .PreviewPicture = objExpression
      

objRet

An IPictureDisp object that represents current preview picture.

object

Required. An expression that returns a Document object.

objExpression

Required. An IPictureDisp object that represents the new preview picture.

Remarks

The PreviewPicture property returns and accepts only EMF files (enhanced metafiles). Visio will raise an exception if objExpression contains a non-EMF file.

To delete an existing preview set the PreviewPicture property to Nothing.

You can use the PreviewPicture property to include a preview pictures in a template that does not have any diagrams stored in it.

COM provides a standard implementation of a picture object with the IPictureDisp interface on top of the underlying system picture support. The IPictureDisp interface exposes a picture object's properties and is implemented in the stdole type library as a StdPicture object creatable within Microsoft Visual Basic. The stdole type library is automatically referenced from all Visual Basic for Applications projects in Visio.

To get information about the StdPicture object that supports the IPictureDisp interface:

  1. On the Tools menu, point to Macros, and then click Visual Basic Editor.
  1. On the View menu, click Object Browser.
  1. In the Project/Library list, click stdole.
  1. Under Classes, examine the class named StdPicture.

For details about the IPictureDisp interface, see the Microsoft Platform SDK on the Microsoft Developer Network (MSDN) Web site.

Currently, only in-proc solutions can use the PreviewPicture property because the IPictureDisp interface cannot be marshaled.