Office 2007 & "This file is locked for editing by..." functionalit

  • Thread starter Thread starter Ben Waldon
  • Start date Start date
B

Ben Waldon

Guest
Hello,
We have recently setup a Windows Server 2003 Enterprise Edition Terminal
Server for ~40 users. We installed Office 07 Pro Plus.

The problem comes when one user has a shared file open & a 2nd user wants to
open that file also. It says that the same user has that file open regardless
of who really it is. I think it's the name we used when we registered it.
Also, when the any user first logs in and uses office for the first time, it
doesn't ask them for "First Name, Last Name, initials". So, if a user would
like to know who else has it open, they don't know who to call.

The fileserver is a seperate server and I looked at Computer Management >
System Tools > Open Files > and it shows the correct user.

I would like for the users to see that the correct user has the file open so
that they can contact the correct user. If that isn't possible, I'd like to
replace the name they are using with something like "Another User" and/or
change the text.

Any assistance would be fantastic.
Thanks,
Ben
--
Ben Waldon
 
Re: Office 2007 & "This file is locked for editing by..." functionalit

Had the same problem - used a script to fix all users, put it in as a call
from the domain logon script. This works for MS Office to version 2003 -
should work for 2007, unless they changed the rules (again). It creates the
user ID from the AD account, creates the "Initials" field also, then pushes
the values into the HKCU part of registry. Please test, especially for
Office 2007. I know it seems to work on 97, 2000, XP, and 2003 versions of
Office. If doesn't work on 2007 - check the registry close to the
appropriate are, and modify the script. Else - someone else here may have
an idea.

----------Script SetMSOfficeName.vbs--------:

Const HKCU = &H80000001
Const HKLM = &H80000002

' Get full username from AD
Set oADSystemInfo = CreateObject("ADSystemInfo")

' get AD user object
Set oADsUser = GetObject("LDAP://" & oADSystemInfo.UserName)

' get full name of the current user
sDisplayName = oADsUser.DisplayName

'Create initials string
arrUserID = split(sDisplayName, " ")
SegNum = UBound(arrUserID)
If SegNum = 0 then strInitial = Left(arrUserID(0),1)
If SegNum = 1 Then
If Left(arrUserID(1),1) <> "(" Then
strInitial = Left(arrUserID(1),1) & Left(arrUserID(0),1)
Else
strInitial = Left(arrUserID(0),1)
End If
End If
If SegNum > 1 Then
If Left(arrUserID(2),1) <> "(" Then
strInitial = Left(arrUserID(1),1) & Left(arrUserID(2),1) &
Left(arrUserID(0),1)
Else
strInitial = Left(arrUserID(1),1) & Left(arrUserID(0),1)
End If
End If

' create a byte array of the name and initials
aUsername = ToByteArray(sDisplayName)
aUserInitials = ToByteArray(strInitial)

Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" _
& ".\root\default:StdRegProv")

aOfficeVersions = Array("12.0","11.0","10.0","9.0","8.0")

' find the Office version(s) installed
For Each sOfficeVersion In aOfficeVersions

sRegKey = "SOFTWARE\Microsoft\Office\" & sOfficeVersion _
& "\Common\InstallRoot"

oReg.GetStringValue HKLM, sRegKey, "Path", sPath

If sPath <> "" Then
' Found an installed Office version, now update UserName value in HKCU

sRegKey = "SOFTWARE\Microsoft\Office\" & sOfficeVersion _
& "\Common\UserInfo"

' create the key if it doesn't exist
oReg.CreateKey HKCU, sRegKey

' set the UserName value
iRC = oReg.SetBinaryValue(HKCU, sRegKey, "UserName", aUsername)
iRC = oReg.SetBinaryValue(HKCU, sRegKey, "UserInitials", aUserInitials)

End If
Next

Function ToByteArray(ByVal sString)

ReDim aBytes(Len(sString) * 2 + 1)

iIndex = -1
For iPos = 1 To Len(sString)
iIndex = iIndex + 1
aBytes(iIndex) = Asc(Mid(sString, iPos, 1))
' add a 0 after each letter
iIndex = iIndex + 1
aBytes(iIndex) = 0
Next

' add two closing 0's
iIndex = iIndex + 1
aBytes(iIndex) = 0
iIndex = iIndex + 1
aBytes(iIndex) = 0

ToByteArray = aBytes
End Function

----------End Script SetMSOfficeName.vbs--------:


"Ben Waldon" <BenWaldon@discussions.microsoft.com> wrote in message
news:57FEB6DB-3511-4D6F-AE3B-CA839C1B622A@microsoft.com...
> Hello,
> We have recently setup a Windows Server 2003 Enterprise Edition Terminal
> Server for ~40 users. We installed Office 07 Pro Plus.
>
> The problem comes when one user has a shared file open & a 2nd user wants
> to
> open that file also. It says that the same user has that file open
> regardless
> of who really it is. I think it's the name we used when we registered it.
> Also, when the any user first logs in and uses office for the first time,
> it
> doesn't ask them for "First Name, Last Name, initials". So, if a user
> would
> like to know who else has it open, they don't know who to call.
>
> The fileserver is a seperate server and I looked at Computer Management >
> System Tools > Open Files > and it shows the correct user.
>
> I would like for the users to see that the correct user has the file open
> so
> that they can contact the correct user. If that isn't possible, I'd like
> to
> replace the name they are using with something like "Another User" and/or
> change the text.
>
> Any assistance would be fantastic.
> Thanks,
> Ben
> --
> Ben Waldon
 
Back
Top