Sabtu, 19 Maret 2016

Re: [ExcelVBA] Creating Shortcut to a Folder on the Desktop

 

Nice.... Should work fine.



LIsa


Sent: Sat, Mar 19, 2016 3:18 pm
Subject: Re: [ExcelVBA] Creating Shortcut to a Folder on the Desktop



Dear Gary

Try this :-
 
Sub CreateShortCut(sFullFileOrFolderPathWithExtension As String, sShortcutTitle As String)
Dim sPathDeskTop As String
    With CreateObject("WScript.Shell")
        sPathDeskTop = .SpecialFolders("Deskt op") & "\"
        With .CreateShortCut(sPathDeskTop & sShortcutTitle & ".lnk")
            .TargetPath = sFullFileOrFolderPathWithExtension
            .Save
        End With
    End With
End Sub

To keep it simple I did not put in error checking and I did not test it with folder names containing spaces. 

Regards

Derek Turner
England +++

__._,_.___

Posted by: Green <1z@compuserve.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------

.

__,_._,___

Tidak ada komentar:

Poskan Komentar