+ Reply to Thread
Results 1 to 4 of 4

Creating Folder Folder in My Documents VBA - HELP

Hybrid View

  1. #1
    Ali
    Guest

    Creating Folder Folder in My Documents VBA - HELP

    Hi,

    I am trying to find out how to create a folder in the My Documents folder.

    I tried looking for system variables that could lead me to the location of
    the my Documents folder, so that I coudl use mkdir and the path, but the
    problem is, the my document is mapped to the server, and not to the
    C:\documents and settings subfolders.

    Will appreciate if i could get some help on this.

    I will eventually want to create folders within the new folder in the My
    Documents.

    Thank you!

    Ali



  2. #2
    Patrick Molloy
    Guest

    RE: Creating Folder Folder in My Documents VBA - HELP

    I',m not sure ...you could record a macro & record the path that way.
    "usuall" the desktop comes under the users path
    C:\Documents and Settings\username
    however, as with my organisation, teh users desktop is saved on a network,
    privately accessible only bu th euser, so that th euser can log-on from any
    station and have access to the correct applications.




    Sub vars()
    Dim index As Long
    index = 1
    On Error Resume Next
    Do
    Cells(index + 1, 1) = index
    Cells(index + 1, 2) = Environ$(index)
    index = index + 1
    Loop Until Err.Number <> 0
    End Sub




    "Ali" wrote:

    > Hi,
    >
    > I am trying to find out how to create a folder in the My Documents folder.
    >
    > I tried looking for system variables that could lead me to the location of
    > the my Documents folder, so that I coudl use mkdir and the path, but the
    > problem is, the my document is mapped to the server, and not to the
    > C:\documents and settings subfolders.
    >
    > Will appreciate if i could get some help on this.
    >
    > I will eventually want to create folders within the new folder in the My
    > Documents.
    >
    > Thank you!
    >
    > Ali
    >
    >
    >


  3. #3
    moi
    Guest

    Re: Creating Folder Folder in My Documents VBA - HELP

    Use WSHost for getting the full MyDocuments path, change to that dir and
    create a new folder.

    Public Sub addMyDocumentsDir()
    Dim wShell, fso, strFldr As String
    Set wShell = CreateObject("WScript.Shell")
    Set fso = CreateObject("Scripting.FileSystemObject")
    strFldr = wShell.SpecialFolders("MyDocuments")
    ChDir (strFldr)
    fso.CreateFolder ("test123")
    End Sub



    "Ali" <ahj@hotmail.comy> schreef in bericht
    news:u8$6zrNkFHA.3580@TK2MSFTNGP09.phx.gbl...
    > Hi,
    >
    > I am trying to find out how to create a folder in the My Documents folder.
    >
    > I tried looking for system variables that could lead me to the location of
    > the my Documents folder, so that I coudl use mkdir and the path, but the
    > problem is, the my document is mapped to the server, and not to the
    > C:\documents and settings subfolders.
    >
    > Will appreciate if i could get some help on this.
    >
    > I will eventually want to create folders within the new folder in the My
    > Documents.
    >
    > Thank you!
    >
    > Ali
    >




  4. #4
    Tj
    Guest

    Re: Creating Folder Folder in My Documents VBA - HELP

    Thank you!! This worked great!

    "moi" wrote:

    > Use WSHost for getting the full MyDocuments path, change to that dir and
    > create a new folder.
    >
    > Public Sub addMyDocumentsDir()
    > Dim wShell, fso, strFldr As String
    > Set wShell = CreateObject("WScript.Shell")
    > Set fso = CreateObject("Scripting.FileSystemObject")
    > strFldr = wShell.SpecialFolders("MyDocuments")
    > ChDir (strFldr)
    > fso.CreateFolder ("test123")
    > End Sub
    >
    >
    >
    > "Ali" <ahj@hotmail.comy> schreef in bericht
    > news:u8$6zrNkFHA.3580@TK2MSFTNGP09.phx.gbl...
    > > Hi,
    > >
    > > I am trying to find out how to create a folder in the My Documents folder.
    > >
    > > I tried looking for system variables that could lead me to the location of
    > > the my Documents folder, so that I coudl use mkdir and the path, but the
    > > problem is, the my document is mapped to the server, and not to the
    > > C:\documents and settings subfolders.
    > >
    > > Will appreciate if i could get some help on this.
    > >
    > > I will eventually want to create folders within the new folder in the My
    > > Documents.
    > >
    > > Thank you!
    > >
    > > Ali
    > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1