how to save to My Documents folder on different PCs

M

Matthew

How do I setup a macro that will save to the "My Documents" folder even
though the path is different on different PC's. Since Win-XP moved the "My
Docs" folder to a differnet place for each user.
 
D

Dave Peterson

One way:

Option Explicit
Sub testme()
Dim myDocumentsPath As String

Dim wsh As Object

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

MsgBox myDocumentsPath

End Sub
 
Top