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

  • Thread starter gils usenet acct
  • 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
 
T

Tony Jollans

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

Other than that your code should work
 

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