Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public strDomainUrl As String
Sub GetDomainURL(strUI As String)
If strUI = "Aldea" Then
If Sheet2.chkServer Then
strDomainUrl = "https://training.aldea.eds.com/"
Else
'strDomainUrl = "https://am.aldea.svcs.hp.com/"
End If
ElseIf strUI = "Aries" Then
If Sheet2.chkServer Then
strDomainUrl = "https://apj-i.svcs.hp.com/training_aries/"
Else
'strDomainUrl = "https://am.aldea.svcs.hp.com/"
End If
End If
End Sub
Function FnUpdateList(ieapp As InternetExplorer, strID As String, strText As String, Optional strTrigger As String)
Dim ListItems As Long
Dim LoopList As Long
Dim ObjListBox As Object
Dim Obj As Object
Application.StatusBar = "Processing " & Left(strText, 150) & "..."
Set Obj = ieapp.Document.GetElementsByName(strID)
Set ObjListBox = Obj(0)
ListItems = ObjListBox.Options.Length
For LoopList = 0 To ListItems
If UCase(Trim(ObjListBox.Item(LoopList).Text)) = UCase(Trim(strText)) Then
ObjListBox.selectedindex = LoopList
Exit For
End If
Next
do_events ieapp
If strTrigger <> "NO" Then ObjListBox.onchange: Sleep 5000
do_events ieapp
End Function
Function FnWait4IE(ieapp As InternetExplorer)
ieapp.Visible = Not (Sheet1.chkShowme)
Sleep 500
Do
DoEvents
Sleep 400
Loop Until ieapp.ReadyState = READYSTATE_COMPLETE And ieapp.Busy = False
End Function
Function FnNavigate(ieapp As InternetExplorer, strURL As String)
ieapp.Navigate strURL
do_events ieapp
End Function
Function FnUpdateByID(ieapp As InternetExplorer, strID As String, strText)
ieapp.Document.GetElementById(strID).Value = strText
do_events ieapp
End Function
Function FnClick(ieapp As InternetExplorer, strID As String)
Application.StatusBar = "Submitting Form..."
do_events ieapp
ieapp.Document.GetElementById(strID).Click
Sleep 2000
do_events ieapp
End Function
Function FnGetText(ieapp As InternetExplorer, strID As String, strText) As String
FnGetText = ieapp.Document.GetElementById(strID).innertext
do_events ieapp
End Function
Function FnUpdateByName(ieapp As InternetExplorer, strFieldName As String, strText As String)
Dim Obj As Object
Set Obj = ieapp.Document.GetElementsByName(strFieldName)
Application.StatusBar = "Processing " & Left(strText, 150) & "..."
Obj(0).Value = strText
End Function
Sub OpenRequestForm()
Dim ObjWord As New Word.Application
Dim ObjWDoc As Word.Document
Dim strFileName As String
Dim rLoop As Long
Set ObjWDoc = ObjWord.Documents.Open(Application.GetOpenFilename(Title:="Please select the Technical Requirements Form"), , True)
rLoop = 8
GetContentInfo ObjWDoc, rLoop
GetFormFieldInfo ObjWDoc, rLoop
ObjWDoc.Close False
ObjWord.Quit
End Sub
Sub GetContentInfo(ObjWDoc As Word.Document, rLoop As Long)
Dim Obj As Word.ContentControls
Dim iLoop As Long
Set Obj = ObjWDoc.Content.ContentControls
For iLoop = 1 To Obj.Count
Sheet3.Cells(rLoop, 8) = Obj(iLoop).Range
rLoop = rLoop + 1
DoEvents
Next iLoop
End Sub
Sub GetFormFieldInfo(ObjWDoc As Word.Document, rLoop As Long)
Dim Obj As Word.FormFields
Dim iLoop As Long
Set Obj = ObjWDoc.FormFields
For iLoop = 1 To Obj.Count
Sheet3.Cells(rLoop, 8) = Obj(iLoop).CheckBox.Value
rLoop = rLoop + 1
DoEvents
Next iLoop
End Sub
Sub WoW()
End Sub