+ Reply to Thread
Results 1 to 2 of 2

Change Display Icon

Hybrid View

Guest Change Display Icon 02-13-2006, 05:25 PM
Guest Re: Change Display Icon 02-14-2006, 01:10 AM
  1. #1
    ben
    Guest

    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. #2
    Jim Cone
    Guest

    Re: 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" <&&&&bw_rgb@hotmail.com(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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1