emergencyplan
Technical User
Hello I am using the following code to create a shortcut to a secured access database:
Dim objShell As WshShell
Dim objShortCut As WshShortcut
'initialize the object wshshell
Set objShell = New WshShell
'initialize the object WshShortcut
Set objShortCut = objShell.CreateShortcut("C:\Documents and Settings\Laurence\Desktop\NewShortCut.lnk"
objShortCut.TargetPath = "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" & "E:\My Documents\Access\Emerg Staff Contacts\Emerg Staff Original.mdb" & "/WRKGRP" & "E:\My Documents\Access\Emerg Staff Contacts\Secured.mdw"
objShortCut.IconLocation = "E:\My Documents\Images\Icons\Penfold.ico"
'save the shortcut
objShortCut.Save
My problem is that the target for the shortcut should read as follows; "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "E:\My Documents\Access\Emerg Staff Contacts\Emerg Staff Original.mdb" /WRKGRP "E:\My Documents\Access\Emerg Staff Contacts\Secured.mdw". Therefore currently it is not working. Notice the missing "" around \WRKGRP.
Does anyone have any suggestion how to make this work. Many thanks.
Dim objShell As WshShell
Dim objShortCut As WshShortcut
'initialize the object wshshell
Set objShell = New WshShell
'initialize the object WshShortcut
Set objShortCut = objShell.CreateShortcut("C:\Documents and Settings\Laurence\Desktop\NewShortCut.lnk"
objShortCut.TargetPath = "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" & "E:\My Documents\Access\Emerg Staff Contacts\Emerg Staff Original.mdb" & "/WRKGRP" & "E:\My Documents\Access\Emerg Staff Contacts\Secured.mdw"
objShortCut.IconLocation = "E:\My Documents\Images\Icons\Penfold.ico"
'save the shortcut
objShortCut.Save
My problem is that the target for the shortcut should read as follows; "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "E:\My Documents\Access\Emerg Staff Contacts\Emerg Staff Original.mdb" /WRKGRP "E:\My Documents\Access\Emerg Staff Contacts\Secured.mdw". Therefore currently it is not working. Notice the missing "" around \WRKGRP.
Does anyone have any suggestion how to make this work. Many thanks.