Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Internet Explorer COM object
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00817045
Message ID:
00817156
Views:
22
Hi Brent,

I couldn't get it to work using DOM either. Anyway, there's a workaround with WSH.
oIE = createobject('InternetExplorer.Application')
oIE.Visible = .T.
oIE.Navigate2("...")
...

oShell = Createobject("wscript.shell")
oShell.AppActivate(oIE.Document.Title)

lcFile1 = "text1.txt"
lcFile2 = "text2.txt"
oShell.SendKeys("{TAB}{TAB}")
oShell.SendKeys(lcFile1)
oShell.SendKeys("{TAB}{TAB}")
oShell.SendKeys(lcFile2)
oShell.SendKeys("{TAB}{TAB}")
...
>I am using Visual FoxPro (v7.0) to create an Internet Explorer COM object and navigate to a site for which I must enter a file name. I have FoxPro enter the name of the file into a text box (actually there are 10 text boxes; I enter the name of the file into the first box). However, each time I submit the form I get a message that says "Please enter a file or file(s) to upload." In trying to find out why this message appears, I coded the following:
>
> oIE.Document.ValidForm.my_file(0).Value="C:\THISISATEST"
>
> WAIT WINDOW "NNN"+oIE.Document.ValidForm.my_file(0).Value+"NNN"
>
>There is no other code between these two statements. The resulting WAIT WINDOW shows:
>NNNNNN. Therefore, I know that the value ("C:\THISISATEST") FoxPro entered did not actually get put in the box. I have used all 10 subscripts to the array my_file and still get the above WAIT WINDOW text.
>
>Does anyone have an idea about why the value "C:\THISISATEST" is not being set in the box?
>
>I get no FoxPro error messages when I run the program that contains the above code. I have included below the HTML code (between Pre tags) for the page I navigate to.
>
>Thank you for your help!!
>>
<snip>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform