Skip to content

Latest commit

 

History

History
85 lines (45 loc) · 1.8 KB

Outlook.OutlookBarShortcut.SetIcon.md

File metadata and controls

85 lines (45 loc) · 1.8 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
OutlookBarShortcut.SetIcon method (Outlook)
vbaol11.chm344
vbaol11.chm344
Outlook.OutlookBarShortcut.SetIcon
d54a60b5-e667-e030-0724-d61be3ad3745
06/08/2017
medium

OutlookBarShortcut.SetIcon method (Outlook)

Sets the icon for the specified shortcut on the Shortcuts pane.

Syntax

expression. SetIcon( _Icon_ )

expression A variable that represents an OutlookBarShortcut object.

Parameters

Name Required/Optional Data type Description
Icon Required Variant The path of the icon.

Example

The following Microsoft Visual Basic for Applications (VBA) example creates a group called MicrosoftSites and adds a shortcut to the Microsoft Network webpage. Then it sets the icon of the shortcut to the icon image MSN.ico located on the user's computer. The example assumes that this icon exists in the specified location.

 Sub CreateMSNShortcutWithIcon() 
 
 Dim exp As Outlook.Explorer 
 
 Dim pans As Outlook.Panes 
 
 Dim bpan As Outlook.OutlookBarPane 
 
 Dim bgrps As Outlook.OutlookBarGroups 
 
 Dim bgrp As Outlook.OutlookBarGroup 
 
 Dim bscs As Outlook.OutlookBarShortcuts 
 
 Dim bsc As Outlook.OutlookBarShortcut 
 
 Dim bsc2 As Outlook.OutlookBarShortcut 
 
 
 
 Set exp = Application.ActiveExplorer 
 
 Set pans = exp.Panes 
 
 Set bpan = pans.Item("OutlookBar") 
 
 Set bgrps = bpan.Contents.Groups 
 
 Set bgrp = bgrps.Add("MicrosoftSites") 
 
 Set bscs = bgrp.Shortcuts 
 
 Set bsc = bscs.Add("https://www.msn.com", "MSN Home Page") 
 
 bsc.SetIcon "C:\MSN.ico" 
 
End Sub

See also

OutlookBarShortcut Object

[!includeSupport and feedback]