Find location of "My Documents" with VBA or Macro in Word (2002/XP

O

Onno B.

We use folder redirection for the My Documents (\\server\share\department)
With Word XP (2002) I need to create an macro wich saves some new documents
to \\server\share\department\files. Therefore I need to 'know' where "My
Documents" is redirected to. How can I find this, so far my best solutions
was to use Dialogs(wdDialogToolsOptionsFileLocations).Setting but users can
change this to a folder of their choice which makes it useless.

btw: the 'department' is different for each department...
 
S

Steve Yandl

Onno,

I've only used the following for situations where the MyDocuments folder has
been redirected somewhere on the user's hard drive but it should work in
cases where there is redirection to a location on the server.

Set objShell = CreateObject("Shell.Application")
Set objFldrMyDocs = objShell.Namespace(&H5&)
strMyDocsPath = objFldrMyDocs.Self.Path
MsgBox strMyDocsPath
Set objShell = Nothing


Steve Yandl
 

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