Solved

another webbrowser question

Posted on 2001-06-03
10
183 Views
Last Modified: 2012-06-22
I hope someone out there is as twisted as me.

I know the webbrowser control pretty well. or so I thought until now.

<html>
<body>
<INPUT name=PICTURE1_SOURCE size=50 type=file accept="image/jpeg,image/jpg">
</body>
</html>

how do I programtically(from VB) set the value of this box. No .value does not work.
0
Comment
Question by:brookman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
10 Comments
 
LVL 51

Expert Comment

by:Ryan Chong
ID: 6151438
Hi, create a html editor?
0
 
LVL 2

Author Comment

by:brookman
ID: 6151440
I have written an application in VB to fill in a web page and submit it.  I can't figure out this file object
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6152248
the file type of the input object does not allow for you to set a default value for security reasons.  you cant set this even if you wrote the html yourself.  you can mimic this behavior with an IE only solution (at least i only ever got it working in IE).  i can post if you are interested, but it is a workaround in which you actually hide the file input object and show a regular text and button object in its place.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:brookman
ID: 6152661
I would like that.  I have tried extensive coding to take apart the html and input the value= string but it gets rid of it.

Let me see what you have.

I tried modifying the html code to change it to a text box instead of a file box to no avail.
0
 
LVL 2

Author Comment

by:brookman
ID: 6152717
Is there a way to do a setfocus of an object in the html document?
0
 
LVL 51

Expert Comment

by:Ryan Chong
ID: 6152729
Sure!
0
 
LVL 2

Author Comment

by:brookman
ID: 6152783
can you be a little more descriptive - I tried the obvious.
web1.document.all("PICTURE1_SOURCE").setfocus does not work.
0
 
LVL 28

Accepted Solution

by:
AzraSound earned 200 total points
ID: 6153166
just try:

web1.document.all("PICTURE1_SOURCE").focus
0
 
LVL 2

Author Comment

by:brookman
ID: 6153203
why the hell can't they stick with a standard - what happened to setfocus? By the way that does it.  I can focus and sendkeys!!!!!Thanks
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 6153214
just if youre interested, here is the html (IE only)


<html>
<script language="javascript">
  function getFile() {
      document.frm.fileChoose.click();
      document.frm.txtFile.value = document.frm.fileChoose.value;
  }
</script>

<body>
<form name="frm">
  <input type="text" name="txtFile" size="25" value="">
  <input type="button" value="Choose a File" onclick="getFile()">
  <layer>
      <input type="file" name="fileChoose" style="visibility:hidden"><br>
  </layer>
</form>
</body>
</html>
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question