Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 4th, 2007, 12:04 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default HTML Guidence

I would like my program to preview writing in the rtf box in html, inside the rtf is html so it would just be previewing the code! I would just like some code suggestion about how to do this!

Cheers to anyone for help

------------------------------------------------
Apocolypse2005
Always ready and waiting to help!
__________________
Apocolypse2005, I'm a programmer - of sorts.
 
Old January 4th, 2007, 11:55 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Perhaps you can give a little better description of what you are asking?

Woody Z
http://www.learntoprogramnow.com
 
Old January 18th, 2007, 07:23 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default

In dreamweaver or frontpage you are able to preview your html page in IE browser or whatever you use, i would just like to know how to do this!

Cheers

------------------------------------------------
Apocolypse2005
Always ready and waiting to help!
 
Old January 18th, 2007, 05:43 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There are probably several ways to do this, but one way would be to save the current text in your rich text box into a temporary file and then fire up the browser by shelling to it.

Here is a very simple, hardcoded, example that will open a file in whichever browser has a file association with the html exension:

ShellExecute 0&, vbNullString, "c:\test.html", vbNullString, vbNullString, vbNormalFocus

Of course, you will need to declare the ShellExecute API function:

Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal Hwnd As Long, ByVal _
    lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, _
    ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long


If you aren't familiar with using API calls, you can search the internet for basic info on doing this from VB6.

Woody Z
http://www.learntoprogramnow.com
 
Old January 20th, 2007, 07:33 AM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default

Cheers, if i incorperated this into my project it would work, or do i need to do something else to get it to work!?

------------------------------------------------
Apocolypse2005
Always ready and waiting to help!
 
Old January 20th, 2007, 12:35 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How do you mean, "do something else"?
Have you tried this yet?
It is very, very simple.
You could have this up and running in a few minutes, but you have to write the code and fix any problems you come upon.

Woody Z
http://www.learntoprogramnow.com
 
Old January 22nd, 2007, 12:53 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default

Thanks, so i cn just incorporate it into my project without extra bits of code, only to fix errors or bugs! Cheers

------------------------------------------------
Apocolypse2005
Always ready and waiting to help!
 
Old January 22nd, 2007, 12:59 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default

Can i use this code here to bypass having to open up the save dialog and getting the user to save it!

Open test.html For Output As intFile
Print #intFile, rtb.Text
ShellExecute 0&, vbNullString, "c:\test.html", vbNullString, vbNullString, vbNormalFocus
Close #intFile

would this work??

Cheers

------------------------------------------------
Apocolypse2005
Always ready and waiting to help!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove orphaned html elements from html string pauliehaha C# 2008 aka C# 3.0 2 June 30th, 2008 09:40 AM
html:errors and html:messages sparun1607 Struts 0 November 23rd, 2006 08:34 AM
Converting an HTML Server Control to HTML Control gratisaccount ASP.NET 1.0 and 1.1 Basics 2 August 7th, 2006 12:29 AM
WanT Guidence For Biginning ASP.Net 2.0 nicesukhi ASP.NET 2.0 Basics 1 July 25th, 2006 05:48 AM
Can you preload child html files to 1parent html? bekim Javascript How-To 4 January 22nd, 2005 04:17 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.