Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

VBScript Form Submission Help

$
0
0

So I'm working with both macro express and vbscript to submit a query on a web tool we have here at work. The macro express side works great and passes the needed variables out to the vbscript as it's launched, but I can't seem to grab focus of a specific element that I have the name for. I suspect it's because the site has frames and I'm just scripting it wrong, but any help would be GREATLY appreciated.

Edit: to clarify some, the site is opened via macro express. I've chosen this method because half the company is still on xp and I didn't know if our machines would let the script create an internet explorer window.

Changed the code, trying a different approach. Still having focus issues on finding that form field.

Dim namedArgs,UfeID,wShell,objShell,objIE
'set data stored in our UfeID Argument to the UfeID Variable
Set namedArgs = wscript.arguments.named
UfeID = namedArgs.item("UfeID")
If UfeID = "" Then
	MsgResult = MsgBox("No UFE ID Detected. Be sure to run the macro from FACETS", vbOKOnly, "iDRS Search " & UfeID & " - Warning")
	Wscript.Quit
End If
Set wShell = CreateObject("Wscript.Shell")
Set objShell = CreateObject("Shell.Application")
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate "http://idrs/idrsimaging/"
objIE.visible = true
WaitIE(winShell)
objIE.document.getElementById("docId").focus
Sub WaitIE(MyIE)
	On Error Resume Next
	Wscript.Sleep 1000
	Do
		Do
		Loop Until MyIE.ReadyState = 4
		Do
		Loop Until Not MyIE.Document is Nothing
		Do
			'Wscript.Echo MyIE.Document.ReadyState
		Loop Until MyIE.Document.ReadyState = "complete"
		If Err.Number = 0 Then
			Exit Do
		Else
			Err.Clear
		End If
	Loop
	Err.Clear
	On Error Goto 0
End Sub

Edit 2: The Frame I'm trying to control and the line where the above script is breaking
<frame src="left_toolbar.asp" name="border" noresize scrolling="auto" marginwidth="0" marginheight="0">
MyIE.Document.GetElementByID("docId").Value = UfeID






Viewing all articles
Browse latest Browse all 15028

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>