From: zuckermanf on
Has anyone used VB5STKIT.DLL ?
I haven't found any documentation other than this code (below).
The code seems to work and I get a return value of 0.
But nothing gets added to my desktop.
Any suggestions?
TIA
Fred



Private Declare Function fCreateShellLink Lib "VB5STKIT.DLL" _
(ByVal lpstrFolderName As String, _
ByVal lpstrLinkName As String, _
ByVal lpstrLinkPath As String, _
ByVal lpstrLinkArgs As String) As Long

Private Sub Command0_Click()
Dim lReturn As Long
Dim Mdesktop As String
Dim Mtarget As String

Mdesktop = "C:\Documents And Settings\Fred\Desktop\"
Mtarget = "C:\Documents And Settings\Fred\My Documents\mdbFiles
\db1.mdb"

'Add to Desktop
lReturn = fCreateShellLink(Mdesktop, "db1", Mtarget, "")
MsgBox lReturn

End Sub
From: Tony Toews [MVP] on
"zuckermanf(a)gmail.com" <zuckermanf(a)gmail.com> wrote:

>Has anyone used VB5STKIT.DLL ?

No. I don't recall exactly where I got the code but the page at
http://www.thescarms.com/vbasic/shelllnk.aspx is what I use in the Auto FE Updater.
Note that while you do create a reference to the shelllnk.tlb file you don't actually
need to distribute it with your application.

shelllnk.tlb is the keyword to use in searching for this code.

Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages - http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see http://www.autofeupdater.com/
Granite Fleet Manager http://www.granitefleet.com/
From: zuckermanf on
To close the loop on this item,
Here's my final solution that seems to be working fine:
Fred



Dim WScript As Object
Dim MyIcon As Object
Dim Mloc As String
Dim Mname As String
Set WScript = CreateObject("WScript.Shell")
Mloc = "H:\Windows NT 5.1 Workstation Profile\Desktop\"
Mname = "TestShortcut.lnk"
Set MyIcon = WScript.CreateShortcut(Mloc & Mname)
MyIcon.TargetPath = "I:\DB Apps\Batches\File.mdb"
MyIcon.Save
Set MyIcon = Nothing
Set WScript = Nothing





On Jan 4, 5:02 pm, "zuckerm...(a)gmail.com" <zuckerm...(a)gmail.com>
wrote:
> Has anyone used VB5STKIT.DLL ?
> I haven't found any documentation other than this code (below).
> The code seems to work and I get a return value of 0.
> But nothing gets added to my desktop.
> Any suggestions?
> TIA
> Fred
>
> Private Declare Function fCreateShellLink Lib "VB5STKIT.DLL" _
> (ByVal lpstrFolderName As String, _
> ByVal lpstrLinkName As String, _
> ByVal lpstrLinkPath As String, _
> ByVal lpstrLinkArgs As String) As Long
>
> Private Sub Command0_Click()
>    Dim lReturn As Long
>    Dim Mdesktop As String
>    Dim Mtarget As String
>
>    Mdesktop = "C:\Documents And Settings\Fred\Desktop\"
>    Mtarget = "C:\Documents And Settings\Fred\My Documents\mdbFiles
> \db1.mdb"
>
>    'Add to Desktop
>    lReturn = fCreateShellLink(Mdesktop, "db1", Mtarget, "")
>    MsgBox lReturn
>
> End Sub