Solved

display file in a text box

Posted on 2000-05-13
4
210 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
[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
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

726 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