[gptalk] Re: OT: office 2003 configuration

  • From: "Nelson, Jamie" <Jamie.Nelson@xxxxxxx>
  • To: <gptalk@xxxxxxxxxxxxx>
  • Date: Thu, 10 Jul 2008 09:48:18 -0500

Yep, see the attached script. It won't necessarily "disable" the prompt,
but run it through a GP Logon script and you should be good to go.

Jamie Nelson | Infrastructure Consultant | BI&T Operations | Devon
Energy | Work: 405.552.8054 | http://www.dvn.com

-----Original Message-----
From: gptalk-bounce@xxxxxxxxxxxxx [mailto:gptalk-bounce@xxxxxxxxxxxxx]
On Behalf Of Graham Turner
Sent: Thursday, July 10, 2008 2:11 AM
To: gptalk@xxxxxxxxxxxxx
Subject: [gptalk] OT: office 2003 configuration

Dear all, this one is prob a bit OT but i will defend myself in that i
intend to implement using VBS in a GPO !

this one is prob real old hat, but wanted to know how you can disable
the prompt by Office 2003 applications for "User name" and initials when
new user logs on to a computer.

i have script to pre-populate the 'userinfo' key values in HKCU with
from the directory but even though pre-populated we still get this
first  time round, which seems to default to the login name

some while ago Jamie (Nelson) posted a note re a Word Automation object
which i did not follow up on ??

assistances gladly received


You can unsubscribe from gptalk by sending email to
gptalk-request@xxxxxxxxxxxxx with 'unsubscribe' in the Subject field OR
by logging into the freelists.org Web interface. Archives for the list
are available at http://www.freelists.org/archives/gptalk/

Confidentiality Warning: This message and any attachments are intended only for 
the use of the intended recipient(s), are confidential, and may be privileged. 
If you are not the intended recipient, you are hereby notified that any review, 
retransmission, conversion to hard copy, copying, circulation or other use of 
all or any portion of this message and any attachments is strictly prohibited. 
If you are not the intended recipient, please notify the sender immediately by 
return e-mail, and delete this message and any attachments from your system. 
'Name: OfficeUserInfo.vbs
'Author: Jamie Nelson
'Version: 1.0
'Purpose: Update user name and user initials in MS Office applications.
'History:                               1.0                     Initial code 

'Option Explicit
On Error Resume Next

'Declare variables, instantiate common script objects

Dim wsn : Set wsn = CreateObject("WScript.Network")

'Begin Execution of Script

Dim objWord : Set objWord = CreateObject("Word.Application")
If IsObject(objWord) Then
        Dim strUserDN : strUserDN = Replace(GetADsPath("user"), "/", "\/")
        Dim objUser : Set objUser = GetObject("LDAP://" & strUserDN)
        Dim strUserName, strUserInitials
        Dim strFName, strMI, strLName
        If IsObject(objUser) Then
                '// Get information from AD User object //
                strFName = Trim(objUser.givenName)
                strMI = Trim(objUser.initials)
                strLName = Trim(objUser.sn)
                strUserName = strFName & " " & strLName
                strUserInitials = UCase(Left(strFName,1))
                If Len(strMI) = 1 Then strUserInitials = strUserInitials & 
                strUserInitials = strUserInitials & UCase(Left(strLName,1))
                objWord.UserName = strUserName
                objWord.UserInitials = strUserInitials
        End If
        Set objUser = Nothing
End If
Set objWord = Nothing

'Clear variables, terminate script

Set wsn = Nothing


'Declare procedures/functions/classes

Function GetADsPath(strObjType)
'Returns the ADsPath of the current user or computer object.

On Error Resume Next
Dim objSysInfoTemp : Set objSysInfoTemp = CreateObject("ADSystemInfo")
Select Case LCase(strObjType)
        Case "computer" : GetADsPath = objSysInfoTemp.ComputerName
        Case "user" : GetADsPath = objSysInfoTemp.UserName
        Case Else : GetADsPath = Null
End Select
Set objSysInfoTemp = Nothing
End Function

Other related posts: