Solved

another webbrowser question

Posted on 2001-06-03
10
181 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
  • 5
  • 3
  • 2
10 Comments
 
LVL 50

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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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 50

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

773 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