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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting default file save location in word and Excel using VBScript

Status
Not open for further replies.

ppuddick

ISP
Nov 15, 2002
56
GB
Hi all,

I'm a complete newbie when it comes to this so thank you in advance for reading.

I have both a logon and logoff vbscript on my Win2003 domain controller. Both of these work like a dream.

Is there anyway I can put something into the logon script that changes the default file save location in Word and Excel (2003) from the default to c:\documents and settings\%user%\my documents to something like \\server\share ?

Would this be able to be in the logon script or would it have to be a seperate script?

Any help would be much appreciated.

Thank you in advance
 
Something like this ?
Const wdDocumentsPath = 0
Set W = CreateObject("Word.Application")
W.Options.DefaultFilePath(wdDocumentsPath) = "\\server\share"
W.Quit
Set W=Nothing

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thank you so much for your prompt reply.

It works and it works a treat. Thank you.

One quick question.

If I wanted files to be saved in users folders within the share would I put something like this? I can't help but think I've missing something in the code (ahem) below

Const wdDocumentsPath = 0
Set W = CreateObject("Word.Application")
W.Options.DefaultFilePath(wdDocumentsPath) = "\\server\share\user\" & _ objNetwork.UserName
W.Quit
Set W=Nothing

Once again, mnany thanks!
 
Provided the objNetwork object is already instantiated:
W.Options.DefaultFilePath(wdDocumentsPath) = "\\server\share\user\" & objNetwork.UserName

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top