I'm having some trouble making some code work in an HTML document. Below is a subroutine I'm trying to code for a personal log in. The subroutine is supposed display a Department Name based upon which security group the individual is a part of in Active Directory. Please could someone give me assistance on why the Department name isn't properly displaying. Span ID information is all correct, and the "red" selection is the code to display the Department name in HTML.

Thanks smile.gif

QUOTE
Option Explicit
Dim oUser, oDepartment

setDepartment
createSplash

Sub setDepartment()
adsPath = "WinNT://" & DOMAIN_NAME & "/" & sUserName
Set oUser = GetObject(adsPath)
For Each Prop In oUser.Groups
Select Case UCase(Prop.Name)
Case "GROUP ONE"
oDepartment = "The First Group"
setDepartment = oDepartment
Case "GROUP TWO"
oDepartment = "The Second Group"
setDepartment = oDepartment
Case Else
oDepartment = "Company Name"
End Select
Next
End Sub

Sub createSplash(sCompName)
On Error Resume Next
Set oIE = CreateObject("InternetExplorer.Application")

With oIE
.navigate "logframe.htm"
' .left = (Screen.Width - 410) / 2
' .top = (Screen.Height - 420) / 3
.resizable=0
.height=460
.width=425
.menubar=0
.toolbar=0
.statusBar=0
.visible=1
End With

Do While oIE.Busy
Wscript.Sleep 100
Loop

oIE.document.all.wname.InnerText = sFullName
oIE.document.all.wcomp.InnerText = wshNetwork.ComputerName
oIE.document.all.wdept.InnerText = oDepartment
End Sub