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. Advertisements

  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. Advertisements

  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. Advertisements

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. LCO

    How do I show a "User Form" created in VBA

    LCO, Sep 20, 2004, in forum: Project Developer
    Replies:
    4
    Views:
    87
  2. Burki
    Replies:
    0
    Views:
    79
    Burki
    Dec 24, 2004
  3. Ricardo
    Replies:
    1
    Views:
    132
    Ricardo
    Mar 29, 2005
  4. phoebe

    how i get full critical path?

    phoebe, Sep 4, 2006, in forum: Project Developer
    Replies:
    0
    Views:
    59
    phoebe
    Sep 4, 2006
  5. Dean C

    VBA Access to folder path used for Save Offline

    Dean C, Feb 15, 2008, in forum: Project Developer
    Replies:
    1
    Views:
    82
    Jan De Messemaeker
    Feb 15, 2008
  6. Kit
    Replies:
    2
    Views:
    154
  7. Replies:
    8
    Views:
    160
  8. Replies:
    3
    Views:
    152
Loading...