1.

Solve : .bat or vbs to change modify user template in word 2007?

Answer»

Word 2007

can I run a bat or vbs file to automacticaly change the file location or the USer Template to a new template I have STORED elsewhere.

If I can, can I SEE a sample code?Batch code is unsuitable for this task. VBScript may help:

Code: [Select]Const wdUserTemplatesPath = 2
Const wdWorkgroupTemplatesPath = 3

Set objWord = CREATEOBJECT("Word.Application")
Set objOptions = objWord.Options

objOptions.DefaultFilePath(wdUserTemplatesPath) = "C:\Templates"
objOptions.DefaultFilePath(wdWorkgroupTemplatesPath) = "C:\Workgroup\Templates"

objWord.Quit

Be aware this code was tested with Word 2002. Hopefully it WORKS for Word 2007. Be SURE to change the paths to something that makes sense on your system.

cool will test this outthank you this works a treat



Discussion

No Comment Found