Control desktop Icon

S

Snowfire

I am using this code to create a launch icon on the desktop..

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 &
"\EngstoreSpecial.lnk")
With MyShortcut
.TargetPath = LocalPathExcelControlSpecial
.Save
End With
Set WSHShell = Nothing
End Sub

Is it possible to control the symbol so a pre-determined picture icon
can be used?
 
D

Dave Peterson

With myShortcut
.IconLocation = "x:\somefolder1\somefolder2\someicon.ico"
...
 
M

Mike H

Yes you can do that, try this

With MyShortcut
.TargetPath = LocalPathExcelControlSpecial
.IconLocation = "%SystemRoot%\system32\SHELL32.dll, 22"
.Save
End With

Now finding out precisely which is which icon in Shell32.dll is something
you'll have to Google for but change the 22 to change to Icon

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top