Re: Create Shortycups in MS-Access ADP
Fletcher,
I realized this after posting it that it simply refers to the location
of the icon file. I was thinking something else.
Regards,
lq
"Fletcher Arnold" <fletch@home.com> wrote in message news:<c12o09$fpr$1@hercules.btinternet.com>...[color=blue]
> "Lauren Quantrell" <laurenquantrell@hotmail.com> wrote in message
> news:47e5bd72.0402190736.2e5680d1@posting.google.c om...[color=green]
> > 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[/color]
>
>
>
> Where do you now hope to store your IconLocation? In a SQL server table, or
> in a location fixed relative to the adp? If so you could look at
> CurrentProject.Path which gives the folder where the adp is. You can
> navigate from there.
>
> Fletcher[/color] |