Focus and not use Tabs?
Moderators: Dorian (MJT support), JRL
Focus and not use Tabs?
Thanks, problem is solved!
Last edited by Shel on Mon May 16, 2005 7:32 pm, edited 9 times in total.
Can you have the Agent ID passed to your Sub OpenPage as a Variable then have VB assign Agent ID to the form element if you dont now the element name or number use MsgBox's to diplay the elements as you loop through them.
Here is a rough example (look at Supports post called "Automate Web forms with IE"
VBSTART
Sub OpenPage(URL,Wait,ElementName,AgentID)
Dim IE
Dim FormNr
Dim ItemNr
Dim TheForm
Set IE = CreateObject("InternetExplorer.Application")
IE.visible = 1
IE.navigate URL
do while IE.Busy and Wait
loop
if IE.Document.All.Tags("FORM").Length = 0 then
MsgBox("No form found in page")
else
for FormNr = 0 to IE.Document.Forms.Length - 1
Set TheForm = IE.Document.Forms(FormNr)
for ItemNr = 0 to TheForm.Elements.Length - 1
if TheForm.Elements(ItemNr).Name = ElementName then
TheForm.Elements(ItemNr).Value = AgentID
exit for
end if
next
next
end if
End Sub
VBEND
Ask>Day-Rates: 1-$12 2-$24 3-$36 4 to 7-$45 8-$57 9-$69 10-$81 11-$90,continue
If>continue=YES
//open IE and navigate to the web page and enter the agent id
VBRun>OpenPage,http://www.airportvalet.com/reservation ... tName,5050
DateStamp>C:\airportparking\ID5050.txt,Yes=5050
Endif
If>continue=NO
DateStamp>C:\airportparking\ID5050.txt,No
Endif
Here is a rough example (look at Supports post called "Automate Web forms with IE"
VBSTART
Sub OpenPage(URL,Wait,ElementName,AgentID)
Dim IE
Dim FormNr
Dim ItemNr
Dim TheForm
Set IE = CreateObject("InternetExplorer.Application")
IE.visible = 1
IE.navigate URL
do while IE.Busy and Wait
loop
if IE.Document.All.Tags("FORM").Length = 0 then
MsgBox("No form found in page")
else
for FormNr = 0 to IE.Document.Forms.Length - 1
Set TheForm = IE.Document.Forms(FormNr)
for ItemNr = 0 to TheForm.Elements.Length - 1
if TheForm.Elements(ItemNr).Name = ElementName then
TheForm.Elements(ItemNr).Value = AgentID
exit for
end if
next
next
end if
End Sub
VBEND
Ask>Day-Rates: 1-$12 2-$24 3-$36 4 to 7-$45 8-$57 9-$69 10-$81 11-$90,continue
If>continue=YES
//open IE and navigate to the web page and enter the agent id
VBRun>OpenPage,http://www.airportvalet.com/reservation ... tName,5050
DateStamp>C:\airportparking\ID5050.txt,Yes=5050
Endif
If>continue=NO
DateStamp>C:\airportparking\ID5050.txt,No
Endif
Hi Solow, THANKS ... did you get that script to work?
I wasn't able to get the # to parse into the AgentID field, I tried your script, and then tried a few variations of with no luck.
If I could get that # to parse or send to the AgentID field by it’s (name) or just get it in the first field in the form/page I’d be thrilled.
Thanks, Shel
I wasn't able to get the # to parse into the AgentID field, I tried your script, and then tried a few variations of with no luck.
If I could get that # to parse or send to the AgentID field by it’s (name) or just get it in the first field in the form/page I’d be thrilled.
Thanks, Shel
Hi Shel
Here is the code that will place "5050" into the first Agent Id Field.
vbstart
Sub WebFormFill(LookFor,IDValue)
Dim IE
Dim FormNR
Dim ItemNE
Dim TheForm
Set IE = CreateObject("InternetExplorer.Application")
IE.visible = 1
IE.navigate "http://www.airportvalet.com/reservation4.htm"
do while IE.Busy or Wait
loop
If IE.Document.All.Tags("FORM").Length = 0 then
MsgBox("No form found in page")
else
for FormNR = 0 to IE.Document.Forms.Length - 1
Set TheForm = IE.Document.Forms(FormNR)
for ItemNR = 0 to TheForm.Elements.Length - 1
If TheForm.Elements(ItemNR).Name = LookFor then
TheForm.Elements(ItemNR).Value = IDValue
End IF
'*******get rid of the rems infront of the message boxs below and you
'*******will get all of the elements listed out one at a time - there are 39
'*******on your web page
'MsgBox(ItemNR)
'MsgBox(TheForm.Elements(ItemNR).Name)
'MsgBox(TheForm.Elements(ItemNR).Value)
Next
Next
End If
End Sub
vbend
VBRun>WebFormFill,AgentID,5050
Regards
shane - Solow
Here is the code that will place "5050" into the first Agent Id Field.
vbstart
Sub WebFormFill(LookFor,IDValue)
Dim IE
Dim FormNR
Dim ItemNE
Dim TheForm
Set IE = CreateObject("InternetExplorer.Application")
IE.visible = 1
IE.navigate "http://www.airportvalet.com/reservation4.htm"
do while IE.Busy or Wait
loop
If IE.Document.All.Tags("FORM").Length = 0 then
MsgBox("No form found in page")
else
for FormNR = 0 to IE.Document.Forms.Length - 1
Set TheForm = IE.Document.Forms(FormNR)
for ItemNR = 0 to TheForm.Elements.Length - 1
If TheForm.Elements(ItemNR).Name = LookFor then
TheForm.Elements(ItemNR).Value = IDValue
End IF
'*******get rid of the rems infront of the message boxs below and you
'*******will get all of the elements listed out one at a time - there are 39
'*******on your web page
'MsgBox(ItemNR)
'MsgBox(TheForm.Elements(ItemNR).Name)
'MsgBox(TheForm.Elements(ItemNR).Value)
Next
Next
End If
End Sub
vbend
VBRun>WebFormFill,AgentID,5050
Regards
shane - Solow
Solow29 wrote:Can you have the Agent ID passed to your Sub OpenPage as a Variable then have VB assign Agent ID to the form element if you dont now the element name or number use MsgBox's to diplay the elements as you loop through them.
Here is a rough example (look at Supports post called "Automate Web forms with IE"
VBSTART
Sub OpenPage(URL,Wait,ElementName)
Dim IE
Dim FormNr
Dim ItemNr
Dim TheForm
Set IE = CreateObject("InternetExplorer.Application")
IE.visible = 1
IE.navigate URL
do while IE.Busy and Wait
loop
if IE.Document.All.Tags("FORM").Length = 0 then
MsgBox("No form found in page")
else
for FormNr = 0 to IE.Document.Forms.Length - 1
Set TheForm = IE.Document.Forms(FormNr)
for ItemNr = 0 to TheForm.Elements.Length - 1
if TheForm.Elements(ItemNr).Name = ElementName then
TheForm.Elements(ItemNr).Value =
exit for
end if
next
next
end if
End Sub
VBEND
Ask>Day-Rates: ,continue
If>continue=YES
//open IE and navigate to the web page and enter the agent id
VBRun>OpenPage,http://www,1,ElementName,5050
DateStamp>C:\airportparking\ID5050.txt,Yes=5050
Endif
If>continue=NO
DateStamp>C:\ID5050.txt,No
Endif
Can you have the Agent ID passed...
Solow29 wrote:Can you have the Agent ID passed to your Sub OpenPage as a Variable then have VB assign Agent ID to the form element if you dont now the element name or number use MsgBox's to diplay the elements as you loop through them.
Here is a rough example (look at Supports post called "Automate Web forms with IE"
VBSTART
Sub OpenPage(URL,Wait,ElementName,AgentID)
Dim IE
Dim FormNr
Dim ItemNr
Dim TheForm
Set IE = CreateObject("InternetExplorer.Application")
IE.visible = 1
IE.navigate URL
do while IE.Busy and Wait
loop
if IE.Document.All.Tags("FORM").Length = 0 then
MsgBox("No form found in page")
else
for FormNr = 0 to IE.Document.Forms.Length - 1
Set TheForm = IE.Document.Forms(FormNr)
for ItemNr = 0 to TheForm.Elements.Length - 1
if TheForm.Elements(ItemNr).Name = ElementName then
TheForm.Elements(ItemNr).Value = AgentID
exit for
end if
next
next
end if
End Sub
VBEND
Ask>Day-Rates: ,continue
If>continue=YES
//open IE and navigate to the web page and enter the agent id
VBRun>OpenPage,http://,1,ElementName,5050
DateStamp>C:\airportparking\ID5050.txt,Yes=5050
Endif
If>continue=NO
DateStamp>C:\ID5050.txt,No
Endif