Page 1 of 1 1
Topic Options
#77862 - 2001-05-22 09:16 AM User Settings for Word 2000
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Hi everybody,

I couldn't get this working under Kix, but I'd thought to share it with you anyways.

It's not that it's not possible with kix but it's beyond my grasp. Maybe someone else (Shawn, CJ, Bryce?) could find the time to convert it to kix code.

code:

'Change Word2K User Settings

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

Tuser=objWSH.Username

Set User = GetObject("WinNT://this.domain.nl/" &Tuser)

Fname=User.fullname

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

wrdapp.quit


------------------
Greetz,

Roger the Young
------------------------
The code is out there...
------------------------

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

_________________________
The Code is out there

Top
#77863 - 2001-05-22 09:41 AM Re: User Settings for Word 2000
cj Offline
MM club member
*****

Registered: 2000-04-06
Posts: 1102
Loc: Brisbane, Australia
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).]

Top
#77864 - 2001-05-22 10:06 AM Re: User Settings for Word 2000
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
Thanx CJ!

I was so focused on VB (the dark side ) I didn't even think of using the good old @FULLNAME & @USERID in the conversion

------------------
Greetz,

Roger the Young
------------------------
The code is out there...
------------------------

_________________________
The Code is out there

Top
#77865 - 2001-05-22 07:40 PM Re: User Settings for Word 2000
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Yoda says:
The dark side is quicker, easier, more seductive.
If you choose the quick and easy path, you will become an agent of evil.

Top
Page 1 of 1 1


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 764 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.053 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.