次の方法で共有


MAPIFolder.GetCustomIcon Method

Returns an StdPicture object that represents the custom icon for the folder.

Namespace:  Microsoft.Office.Interop.Outlook
Assembly:  Microsoft.Office.Interop.Outlook (in Microsoft.Office.Interop.Outlook.dll)

Syntax

'Declaration
<DispIdAttribute()> _
Function GetCustomIcon As StdPicture
'Usage
Dim instance As MAPIFolder
Dim returnValue As StdPicture

returnValue = instance.GetCustomIcon()
[DispIdAttribute()]
StdPicture GetCustomIcon()

Return Value

Type: StdPicture
Returns an StdPicture object that represents a custom icon for the folder.

Remarks

The returned StdPicture object has its Type property equal to PICTYPE_ICON or PICTYPE_BITMAP.

GetCustomIcon returns Nothing (a null reference (Nothing in Visual Basic) in C#) if the folder does not have a custom folder icon, or if the folder belongs to one of the following groups of folders:

  • Default folders (as listed by the OlDefaultFolders enumeration)

  • Special folders (as listed by the OlSpecialFolders enumeration)

  • Exchange public folders

  • Root folder of any Exchange mailbox

  • Hidden folders

You can only call GetCustomIcon from code that runs in-process as Outlook. An StdPicture object cannot be marshaled across process boundaries. If you attempt to call GetCustomIcon from out-of-process code, an exception occurs. For more information, see An automation server cannot pass a pointer to the picture object's IPictureDisp implementation across process boundaries.

See Also

Reference

MAPIFolder Interface

MAPIFolder Members

Microsoft.Office.Interop.Outlook Namespace