as we are migrating from NT 4+Office 97 to XT+Office 2003, i recently wrote a script very similar to yours :
Code:
;-- try to connect to WORD --
dim $WordUsername, $WordUserInitials, $WordUserAddress
;
; initialize here the $WordUserXXXX variables
;
$objWord = CreateObject("Word.Application")
if not @error
$objWord.UserName = $WordUsername
$objWord.UserInitials = $WordUserInitials
$objWord.UserAddress = $WordUserAddress
$objWord.Quit
$objWord = nothing
endif
here is a piece of code.
No need to convert ANSI string to unicode,
No need to know registry keys and values.
When i started to test this code, i was very surprised to see that it is working on office 2003 AND office 97.
in fact, the global script i use, is more complex because i read informations in AD (sn, givenname, initials, company, streetaddress, postofficebox,postalcode, l) and if initials in AD are not set but those in MS-Word are, then i set user initials in AD because it is a field that administrators never set in my company (initials are not used very often in France)
If you are interested, i can post the complete script.
_________________________
Christophe