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

Get Word template folder?

Status
Not open for further replies.

GrodanBoll

Programmer
Mar 6, 2002
45
ZA
Hi

I have made som templates for my company that I now would like to copy to the users comuters via vbscript.

But I can't find the variable for words template path (i.e. 'C:\Documents and Settings\Andreas\Application Data\Microsoft\Mallar') i can only get the template folder under the user name (i.e. 'C:\Documents and Settings\Andreas\Templates').
I get the latter path trough
Code:
WshShell.SpecialFolders("Templates")

Since the OS and Office package is in English I can of course use
Code:
Set WshNetwork = WScript.CreateObject("WScript.Network")
usr = WshNetwork.UserName
And add it to
Code:
path = "C:\Documents and Settings\" & usr & "\Application Data\Microsoft\Template"

But it will fail if there will be someother language in OS or Office package.

I have not found any variable in registry either.

Can I get this variable outside of Word?


Thanks
Grodan
 
And what about this starting point ?
Set S = CreateObject("WScript.Shell")
Set E = S.Environment("PROCESS")
T=E("APPDATA")
WScript.Echo T

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

Part and Inventory Search

Sponsor

Back
Top