code for creating a new folder in current user's My Documents?

  • Thread starter Thread starter gils usenet acct
  • Start date Start date
G

gils usenet acct

Hi All,

I am having trouble with making code for creating a folder in the current
user's My Documents folder. Recommendations?

Dim objFSO As Object

Set objFSO = CreateObject("scripting.FileSystemObject")

objFSO.CreateFolder (("C:\Documents & Settings\" & Environ("UserName") _

& "\My Documents\myNewFolder"))

Set objFSO = Nothing



tia

:)

Gil
 
It is called Documents *and* Settings (not Documents & Settings)
... and My Documents only has a single space

Other than that your code should work
 
Back
Top