Arthur
(Fresh Scripter)
2007-11-05 05:31 AM
Office 2007 template location

hello everyone, I want to add a reg key when a key does not exist

I need add UserTemplates RED_EXPAMD_SZ J:\test

What can I do,Pls help me.


NTDOCAdministrator
(KiX Master)
2007-11-05 06:12 AM
Re: Office 2007 template location

Well it could be that you don't have the string in quotes and you're getting an error but since you don't show or log it you don't know.


Try using this instead.

 Code:
Dim $WV
$WV = WriteValue("HKCU\Software\Microsoft\Office\12.0\Common\General","UserTemplates","j:\test","REG_EXPAND_SZ")
'Key update value: ' + @ERROR + ' - ' + @SERROR ?



How to manage templates in 2007 Office programs
http://support.microsoft.com/kb/924460

Frequently asked questions about the location of templates in Word 2003 or in Word 2007
http://support.microsoft.com/kb/826867

Provide custom Information Rights Management rights policy templates in Office 2007
http://technet2.microsoft.com/Office/en-...3.mspx?mfr=true

Create, remove, or change a trusted location for your files
http://office.microsoft.com/en-us/word/HA100319991033.aspx


Arthur
(Fresh Scripter)
2007-11-05 06:35 AM
Re: Office 2007 template location

Shoud I use addkey to add a regedit in HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\General


then use writevalue to change the value of regedit?


NTDOCAdministrator
(KiX Master)
2007-11-05 09:11 AM
Re: Office 2007 template location

Nope, WriteValue will create at any level all on it's own.