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
Solved

display file in a text box

Posted on 2000-05-13
4
209 Views
Last Modified: 2010-05-02
I have some html files that the user can choose from a list on a form.  The file is a basic html file with mostly text.  I'm interested in finding a way to show the html file(not the code part) in a textbox or the like so the user can preview the file before selecting it.  Is this possible?
0
Comment
Question by:Daron1
4 Comments
 
LVL 7

Expert Comment

by:Vbmaster
ID: 2807594
You can not use a simple textbox for this, you can try the webbrowser control. It's there in the menu Project -> Components -> select "Microsoft Internet Controls" in the list and you will get the control in the Toolbox.
0
 
LVL 14

Accepted Solution

by:
wsh2 earned 75 total points
ID: 2807790
A quick way to generate sample Web Browser code is to use the VB Application Wizard which appears on the same screen as where you select a Standard.Exe project. Answer the first couple of questions anyway you like, then take Yes at the "Do you want your users to be able to access the Internet from your application?". Hit the finish button.. and the VB program is built.

In the project you will find a form named frmBrowser and in it the basics of Internet Webcontrol programming.. complete with backwards and forward code.. and a combobox for previous previously displayed HTML. The method you will be most interested in is the

brwWebBrowser.Navigate URL

Obviously, in this case, you will be using FileNames rather than URLs and as such a call would look like.. brwWebBrowser.Navigate c:\MyPath\MyFile.HTM

From the code generated, copy/paste what you want into your project.. or.. just delete everything you do not want in the VB Application Wizard generated program.. <smile>


0
 

Expert Comment

by:pramesh
ID: 2807857
Try with RichTextbox control.
0
 

Author Comment

by:Daron1
ID: 2808203
This is good.  I have the browser on a form and I set the file for the browser to show like this:

webbrowser.navigate app.path & "\myfile.html"

when I do this, it only shows that the page cannot be found.  I also tried this:

dim mypath as string
mypath= app.path & "\myfile.html"
webbrowser.navigate mypath

this gives the same error.  I know the file is where it should, but why would this not show?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to open Waze.com/livemap from address saved in DB? 26 206
How to Add / Edit Windows Menu 4 67
Zip Folders Using Chilkat Routines 1 58
backup program with robocopy 6 42
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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…

790 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