Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

display file in a text box

Posted on 2000-05-13
4
Medium Priority
?
222 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 300 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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 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…
Suggested Courses

604 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