VBA code to get path to user's My Documents folder

Discussion in 'Project Developer' started by DraNoel, Aug 4, 2009.

  1. DraNoel

    DraNoel Guest

    I have a Project 2007 VBA script that needs to find the full path to the
    current user's My Documents folder. I know this is a simple task in VB.NET
    (just reference the MyDocuments property in My.Computer.FileSystem), but is
    there a straightforward way to find the path in a VBA script? Thanks.
     
    DraNoel, Aug 4, 2009
    #1
    1. Advertising

  2. DraNoel

    Rod Gill Guest

    Unfortunately not.

    --

    Rod Gill
    Microsoft MVP for Project

    Author of the only book on Project VBA, see:
    http://www.projectvbabook.com



    "DraNoel" <> wrote in message
    news:...
    >I have a Project 2007 VBA script that needs to find the full path to the
    > current user's My Documents folder. I know this is a simple task in
    > VB.NET
    > (just reference the MyDocuments property in My.Computer.FileSystem), but
    > is
    > there a straightforward way to find the path in a VBA script? Thanks.
     
    Rod Gill, Aug 4, 2009
    #2
    1. Advertising

  3. DraNoel

    Seawolf Guest

    Chip Pearson has some really good example code on his consulting website :
    http://www.cpearson.com/excel/SpecialFolders.aspx.

    "DraNoel" wrote:

    > I have a Project 2007 VBA script that needs to find the full path to the
    > current user's My Documents folder. I know this is a simple task in VB.NET
    > (just reference the MyDocuments property in My.Computer.FileSystem), but is
    > there a straightforward way to find the path in a VBA script? Thanks.
     
    Seawolf, Aug 6, 2009
    #3
  4. DraNoel

    DraNoel Guest

    Seawolf, thanks for the information. My colleague referred me to another
    blog site,
    http://www.dailydoseofexcel.com/archives/2009/02/26/get-the-path-to-my-documents-in-vba/.
    They suggested an approach using Wxcript, and so far it appears to be
    working.

    "Seawolf" wrote:

    > Chip Pearson has some really good example code on his consulting website :
    > http://www.cpearson.com/excel/SpecialFolders.aspx.
    >
    > "DraNoel" wrote:
    >
    > > I have a Project 2007 VBA script that needs to find the full path to the
    > > current user's My Documents folder. I know this is a simple task in VB.NET
    > > (just reference the MyDocuments property in My.Computer.FileSystem), but is
    > > there a straightforward way to find the path in a VBA script? Thanks.
     
    DraNoel, Aug 6, 2009
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brendan Reynolds

    Relative path to user's Documents folder in shortcut?

    Brendan Reynolds, Dec 3, 2008, in forum: Access General
    Replies:
    6
    Views:
    70
    Brendan Reynolds
    Dec 3, 2008
  2. Bob Valentine

    Need function to get full path to My Documents folder

    Bob Valentine, Jun 25, 2007, in forum: Access VBA Modules
    Replies:
    2
    Views:
    76
    Bob Valentine
    Jun 25, 2007
  3. Author
    Replies:
    4
    Views:
    93
    Klatuu
    Aug 28, 2008
  4. Paul Sweeney
    Replies:
    3
    Views:
    52
    Paul Berkowitz
    Nov 24, 2004
  5. The Writings

    VBA to find path of User created folder

    The Writings, Feb 13, 2012, in forum: Outlook VBA Programming
    Replies:
    4
    Views:
    465
    The Writings
    Feb 18, 2012
Loading...

Share This Page