Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Entering Text Into Ie With Vb


  • Please log in to reply
No replies to this topic

#1 Treikayan

Treikayan

  • Members
  • 57 posts
  • OFFLINE
  •  
  • Local time:01:40 AM

Posted 09 May 2007 - 04:20 PM

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 :thumbsup:

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


Edited by Treikayan, 09 May 2007 - 04:23 PM.

Procrastinate Now!!!

BC AdBot (Login to Remove)

 


m



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users