This is a cool piece of VBS!!

Here is the mistake

WordUser.vbs

code:

'Change Word2K User Settings

Set ObjWSH = WScript.CreateObject("WScript.Network")
Set WrdApp = WScript.CreateObject("Word.Application")

username=objWSH.Username

Set User = GetObject("WinNT://activesky/" &username)

Fname=User.fullname

WrdApp.UserName = Fname
WrdApp.UserInitials = username
WrdApp.UserAddress = "123 Main Street" & Chr(13) & Chr(10) & "12341234 CA " & Chr(13) & Chr(10) & "CHIGAGO"

wrdapp.quit


The User should have been username.

Here is the KiX2k version:

WordUser.k2k

code:

break on
cls


;Change Word2K User Settings
"Updating MSWord user information for @userid..."


; create Word Application Object
$WrdApp = CreateObject("Word.Application")


; Setup Word User Parameters
$WrdApp.UserName = @fullname
$WrdApp.UserInitials = @userid
$WrdApp.UserAddress = "123 Main Street" + Chr(13) + Chr(10) + "12341234 CA " + Chr(13) + Chr(10) + "CHIGAGO"


; Close Word Application Object
$WrdApp.quit()


"done!" ?


Note - this KiX script requires that MSWord is NOT running.

cj

------------------
cj's scripts page
cj's User Guide - 14 May 2001

chrismat@ozemail.com.au


 

[This message has been edited by cj (edited 22 May 2001).]