Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 67
Default Change Display Icon

Is there a way change the display icon of a shortcut on the desktop either
with vba or an api call?
--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Change Display Icon

ben,

If the icon already exits, then the code replaces it.
So change the icon name/path and run the code.
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware

'-------------------------------
Sub Desktopshortcut()
Dim WSHShell As Object
Dim MyShortcut As Object
Dim DesktopPath As String

Set WSHShell = CreateObject("WScript.Shell")
DesktopPath = WSHShell.SpecialFolders("Desktop")
Set MyShortcut = WSHShell.CreateShortcut(DesktopPath & "\macrofun.lnk")
With MyShortcut
.TargetPath = _
"C:\Documents and Settings\user\My Documents\Excel Files\Help Files\macrofun.hlp"
.IconLocation = "F:\Icons\Arrows\ARW03DN.ICO"
.WindowStyle = 1
.Save
End With

Set WSHShell = Nothing
Set MyShortcut = Nothing
MsgBox "A shortcut has been placed on your desktop. ", vbInformation, " Primitive Software"
End Sub
'-------------------------


"ben" (remove this if mailing direct)
wrote in message
Is there a way change the display icon of a shortcut on the desktop either
with vba or an api call?
--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Icon Sets - Display icon in one cell depending upon value in anoth Nolene Excel Worksheet Functions 2 February 26th 10 05:43 AM
how to display the drop down menu icon? Oligo Excel Discussion (Misc queries) 1 October 29th 08 08:29 PM
can't display link as icon sgawler Excel Worksheet Functions 0 April 11th 08 04:56 PM
Changing Display Icon ben Excel Programming 3 February 13th 06 11:32 PM
Toggling Display as Icon for OLE Object [email protected] Excel Programming 0 July 13th 05 09:13 PM


All times are GMT +1. The time now is 01:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"