Need to create script to create shortcut to a folder from vba

maximyshka
maximyshka used Ask the Experts™
on
Hi,

Need to create shortcut to a folder using vba in ms access application. can any one help?



thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014
Commented:
Hi, add a Reference to the Microsoft Scripting Runtime Library, then use this code.

Regards,

Rob.
strLnkLocation = "C:\MyShortcut.lnk"
strFolder = "C:\Temp"
Set objShell = CreateObject("Wscript.Shell")
Set objShortcut = objShell.CreateShortcut(strLnkLocation)
objShortcut.TargetPath = strFolder
objShortcut.WorkingDirectory = strFolder
objShortcut.Save

Open in new window

Dirk HaestProject manager

Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial