Icon Property [Visio 2003 SDK Documentation]

Returns the icon contained in a master or master shortcut.

objRet = object**.Icon**

object.Icon = objVal

objRet     An IPictureDisp object that represents an icon.

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

objVal     An IPictureDisp object that represents a new icon.

Version added

2002

Remarks

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

COM provides a standard implementation of a picture object that has 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 (VBA) 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.
  2. On the View menu, click Object Browser.
  3. In the Project/Library list, click stdole.
  4. Under Classes, examine the class named StdPicture.

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

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

Applies to | Master object | MasterShortcut object

See Also | CopyPreviewPicture method | Picture property | PreviewPicture property