I used to use this code to create shortcuts in my Access Jet MBD
programs but it won't work in Access ADP projects. I know it's related
to reference to CurrentDB.Properties (where it errors). IS there an
equivalent to do this in an ADP???
Any help is appreciated.
lq
Private Function CreateShortcut(myPath As String, myDest As Long,
dDrive As String)
Dim WScript As Object, myShortcut As Object, Sc As String
Set WScript = CreateObject("WScript.Shell")
Sc = GetSpecialFolderLocation(myDest)
Set myShortcut = WScript.CreateShortcut(Sc & "\NewsBase" & ".lnk")
myShortcut.TargetPath = myPath
On Error GoTo err_IconomyShortcut
myShortcut.IconLocation = CurrentDb.Properties("AppIcon")
myShortcut.WorkingDirectory = dDrive & ":\NewsBase"
myShortcut.Save
exit_CreateShortcut:
Set myShortcut = Nothing
Set WScript = Nothing
Exit Function
err_IconomyShortcut:
If Err.Number = 3270 Then
myShortcut.IconLocation = SysCmd(acSysCmdAccessDir) &
"\msaccess.exe, 1"
Resume Next
Else
MsgBox Err.Description
GoTo exit_CreateShortcut
End If
End Function