How to get the path of the Window Desktop folder?

K

KHW24

Dear all,
The Desktop paths for different Window system and for different users are
not the same . How can I get the Destop path for the Window system under
which my VBA program is running?

Best regards,
KHW24
 
J

Jay Freedman

Use the Windows Scripting Shell:

Dim WSHShell
Dim DTpath As String

Set WSHShell = CreateObject("WScript.Shell")
DTpath = WSHShell.SpecialFolders("Desktop")

MsgBox DTpath

Set WSHShell = Nothing

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top