Function 取得桌面路徑() 'GetDeskDir() '取得桌面 http://it-easy.tw/vb-get-path/
Dim wshshell As Object '宣告wshshell為一個Object
' Dim strDesktop As String 'strDesktop變數儲存wshshell.regread的傳回值
Set wshshell = CreateObject("wscript.shell") '將"wscript.shell"載入到wshshell內
' strDesktop = wshshell.regread("HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerShell FoldersDesktop") '取得桌面路徑
' Print "桌面路徑為:"; strDesktop
取得桌面路徑 = wshshell.regread("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Desktop") '取得桌面路徑
' -------
'http://club.excelhome.net/thread-260793-1-1.html
'aa = CreateObject("WScript.Shell").SpecialFolders("Desktop")
'MsgBox aa
'-------
'VBA.Environ("USERPROFILE") & "\桌面"
End Function