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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top