ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Getting the address of 'MyDocuments' (https://www.excelbanter.com/excel-programming/436802-getting-address-mydocuments.html)

Michelle

Getting the address of 'MyDocuments'
 
Hello, I want to be able to refer to a user's 'MyDocuments' folder -
whatever operating system/network/etc. they are using.

Is there a way to refer to it that isn't dependant on their setup?

Thanks

M


Dave Peterson

Getting the address of 'MyDocuments'
 
I use:

Dim myDocumentsPath As String

myDocumentsPath = CreateObject("WScript.Shell") _
.SpecialFolders.Item("mydocuments")

MsgBox myDocumentsPath

Michelle wrote:

Hello, I want to be able to refer to a user's 'MyDocuments' folder -
whatever operating system/network/etc. they are using.

Is there a way to refer to it that isn't dependant on their setup?

Thanks

M


--

Dave Peterson

Michelle

Getting the address of 'MyDocuments'
 
Not bad! - that seems to do just what I want. Thank you

M


"Dave Peterson" wrote in message
...
I use:

Dim myDocumentsPath As String

myDocumentsPath = CreateObject("WScript.Shell") _
.SpecialFolders.Item("mydocuments")

MsgBox myDocumentsPath

Michelle wrote:

Hello, I want to be able to refer to a user's 'MyDocuments' folder -
whatever operating system/network/etc. they are using.

Is there a way to refer to it that isn't dependant on their setup?

Thanks

M


--

Dave Peterson



John Keith

Getting the address of 'MyDocuments'
 
Dave,

Thanks for the tip! I've used the environ("user") and put that in an
explicit path but like your suggestion.

On Mon, 30 Nov 2009 07:46:18 -0600, Dave Peterson
wrote:

I use:

Dim myDocumentsPath As String

myDocumentsPath = CreateObject("WScript.Shell") _
.SpecialFolders.Item("mydocuments")



John Keith



All times are GMT +1. The time now is 03:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com