Icon property

Microsoft Visio Developer Reference

Icon property

   Example   

Returns the icon contained in a master, master shortcut, or window.

Version Added

2002

Syntax

objRet = object.Icon
object.Icon = objVal

objRet

An IPictureDisp object that represents an icon.

object

Required. An expression that returns a Master, MasterShortcut, or Window object.

objVal

An IPictureDisp object that represents a new icon.

Remarks

The Icon property returns and accepts only HICON files. Visio raises an exception if objExpression contains a non-HICON file.

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 Application 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 Icon property because the IPictureDisp interface cannot be marshaled.