Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change default file location 2

Status
Not open for further replies.

ETID

Programmer
Jul 6, 2001
1,867
US
Hi,

Can anyone give me the syntax/example, for capturing the default file location and passing the path to a string , then changing the default file location from a different string variable?

thanks....
 
Macro Recorder - a wonderful invention:

mOldPath = application.Defaultfilepath
With Application
.DefaultFilePath = myNewPath
End With

Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Just as well I checked before posting so I didn't look as if I'm copying!!!!!!

For Word
Code:
Options.DefaultFilePath(Path:=wdDocumentsPath)
is the line to read. To write just add '= string'

If your not looking for application specific I think there may be an environment variable (can't check in depth as I run win95 at home) which you can read using
Environ("variablename")
However, I don't think they can be easily written to - possible need APIs

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
LOL - nice one by the way - did you see how grumpy ol' Houllier was ;-)

Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
I think that's Houllier's natural expression!!

It was a very long day but worth it. Roll on next season and if I'm working a trip to Barcelona or Rome or or or...

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top