code:
Updating this thread with my code for Office XP.
Our AD uses last-name-first fullnames, so there's code in here to "turn around" the user's name.
---------------------------------------------
$comma = instr(@fullname,",")
$firstname = ltrim(substr(@fullname,$comma+1,len(@fullname)-$comma))
$middleinitial=("")
if instr(@fullname,".")
$middleinitial=ltrim(substr($firstname,len($firstname)-2,2))
endif
$lastname = ltrim(substr(@fullname,1,$comma-1))
$firstnamefirst=$firstname + (" ") + $lastname
$firstinitial = ltrim(substr($firstname, 1, 1))
$lastinitial = ltrim(substr($lastname, 1, 1))
$initials=$firstinitial + $middleinitial + $lastinitial
$x=1
$usernamehex=''
while $X<len(''+$firstnamefirst)+1
$usernamehex=$usernamehex+dectohex(asc(substr($firstnamefirst,$x,1)))+'00'
$x = $x + 1
loop
$usernamehex=$usernamehex + '0000'
$x=1
$userinitialshex=''
while $X<len(''+$initials)+1
$userinitalshex=$userinitialshex+dectohex(asc(substr($initials,$x,1)))+'00'
$x = $x + 1
loop
$userinitialshex=$userinitialshex + '0000'
WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Common\UserInfo", "UserName", $usernamehex, "reg_binary")
WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Common\UserInfo", "UserInitials", $userinitialshex, "reg_binary")