Re: Add item to Start Menu
- From: Dave Peterson <petersod@xxxxxxxxxxxxxxxx>
- Date: Thu, 24 May 2007 13:37:17 -0500
There is a startmenu for both the current user and All Users.
Ron de Bruin has some sample code to find that folder:
http://www.rondebruin.nl/folder.htm#SpecialFolders
And here's an old post that shows how to add a shortcut to the desktop.
Option Explicit
Sub CreateShortCut()
Dim oWSH As Object
Dim oShortcut As Object
Dim sPathDeskTop As String
Dim testStr As String
Dim myNewName As String
Set oWSH = CreateObject("WScript.Shell")
sPathDeskTop = oWSH.SpecialFolders("Desktop")
myNewName = "Something else goes here" '<-- change this line
testStr = ""
On Error Resume Next
testStr = Dir(sPathDeskTop & "\" & myNewName & ".lnk")
On Error GoTo 0
If testStr = "" Then
'------------------ If shortcut not found create
Set oShortcut = oWSH.CreateShortCut(sPathDeskTop & "\" & _
myNewName & ".lnk")
With oShortcut
.Description = "Creditors" & vbCrLf & _
"Reconciliation"
.TargetPath = ActiveWorkbook.FullName
.IconLocation = "\\nv09002\tpdrive\TM-Recon\macro\scale.ico"
.Save
End With
Set oWSH = Nothing
'-Msg to tell user about the folders & shortcut
Application.StatusBar = False
MsgBox "The desktop shortcut has been installed"
Else
MsgBox "The desktop shortcut is already installed"
End If
End Sub
Maybe you can combine the two and end up with what you want.
joeeng wrote:
Is there a way to add an item to the Start Menu in a similar way as adding a
shortcut to the Desktop?
--
Dave Peterson
.
- Prev by Date: RE: Is it possible to hide and show buttons?
- Next by Date: Re: "Loop" to exit For loop?
- Previous by thread: Re: Add item to Start Menu
- Next by thread: Re: "Loop" to exit For loop?
- Index(es):