Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




HTML Printing?


I made an app which downloads an HTML file from the internet (like google.com)... now I need to spool it.

Anyone know how to print an HTML file?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Well Printing To HTML (not Printing A HTML Page)
How would I take a group of database records and create a HTML page from them (I would like to do without going thru Access, if possible)...

Basically, my real goal would be able to print custom reports I made user Printer.print and then give the user the option as saving this report in HTML (WYSIWYG fromat).

Any ideas? Is this far-etched?

Printing HTML To File NOT As HTML. (See Inside)
OK, I am writing a program that recognises forum markup and converts it to HTML. For the specific forum I am writing it for, HTML goes unrecognised. I've finished the markup conversion code, but stumbled across the fact that putting HTML in the simulated "Post Area" and hitting Preview will actually cause that to be working HTML. Here's what I mean broken down a little.

<font color=red>Example.</font>

This posted on the forum will show: <font color=red>Example.</font>

But on my program it will show: Example.

I've pretty much figured out how to fix this, since if I convert...

<font color=red>Example.</font>

TO

&lt;font color=red&gt;hahaha&lt;/font&gt;

It will show up as text just fine. However, here's where the problem is. I need an easier way to track any instance of html used and convert it. I could manually replace all pieces of HTML like above, but that would mean masses and masses of code, and I'd never manage to nail every single piece of HTML around. Surely there is an easier way to do this? Help would be much appreciated.

Printing HTML From Within VB
I have designed several forms using HTML code that are currently in use to format emails that I am sending from various parts of my VB 6 application. At various points in the application, I have provided the user with a Print button. Currently, this button simply uses the PrintForm command. However, this is limited due to the fact that the field length is greater than the capability of the form to display at one time. This leads to the user not being able to see all the information available when he prints the form.

I would like to be able to attach the HTML code to the program and allow the user to initiate a print that would then generate a nicely formatted printout.

Using the Printer. print command does not work as it simply spits out what amounts to the HTML source code.

Does anyone have any suggestions on a method to handle this item?

Thanks for the help.

Printing HTML
Does anyone know of a way to print HTML without using the Internet Explorer Object? I ask as I need a way to print multiple pages (only asking for the settings at the start and using them throughout), and to print without the headers and footers that IE adds by default

Thanks

Printing HTML
Hi all,

What is the easiest way of printing in html format?? I tried with a webbrowser1 but when it printed it printed out the "This page cannot be displayed" however in the browser it is fine.

Are there any other methods??

Thanks,

Ross

Printing A Html Doc
I know i asked this question befor but the solution i got did not solve my problem. I need to send a file to the printer for printing. The code i currently have just prints the location of the file and i understand why. Buy how do i send the file to the printer for printing. Here is a code snippet.


VB Code:
Printer.Print App.Path & "Testing.html"

Printing HTML
I want to Print an HTML document without IE prompting me for a printer which is what happens when Shellexecute is used.

I have a file on the hard drive, "Label.html". Is there a way to print this using VB so that IE/Windows does not prompt me to choose a printer and just chooses the default printer.


Thank you
Adam

Printing HTML?
Is there a control out there or something that lets me print HTML (not the code, but how it looks in a browser)? My program, PassProg, supports exporting to HTML and printing, but it would be much easier to ditch the printing code and just print the HTML It would look better, too, as my printing code can't do line wrapping?

So, is there an ActiveX control, DLL, whatever or other code to print web pages?

Printing HTML Using VB6
I'm using the below code to add links to a webpage. However, VB is taking it upon itself to underline all of the links. Is there a way around this, so the links are not underlined?

'code'

Dim SN As Variant
Dim URL As Variant

SN = Data2.Recordset.Fields("SiteName")
URL = Data2.Recordset.Fields("MainURL")

Print #1, " <a href=" & URL & ">" & SN & "</A><BR><BR> "

'code'

That is the jist of it. Any suggestions?

Printing HTML
Hi all, i have a problem here. im trying to print an html page with its contents. i can use the IE builtin print() function but its prompts a dialog box. is there any way i can bypass the dialog box and print the page without the user interaction?? any help woulb be greatly appreciated.

Thanks!

Printing Html
Hi, I need to print on screen and then on printer a html file.
Should I use WebBrowser control to do that and if yes, how do I implement print preview and printing?

thanks.

Printing HTML In VB
I have a program in VB that opens an HTML file using this command

Shell "start file:///c:Sourcevb_phonesphonelist.html ", vbHide

I want to hide the menu bar when it opens the "phonelist.html" file, what is the command to do it.

I want print this to a printer too, what is the command for this?

Printing HTML
How do I load an HTML file to a VB form? I tried to load it as a picture it didn't work. Then I want to print the HTML file that is loaded.

Printing HTML Documents.
Ok.. Here goes..
We are using StarOffice to generate HTML documents.
Using the header and footer options on the pages, Star Office previews and prints the pages correctly.. i.e. With the header and footer on EACH page.

When viewed in the WebBrowser control, however, the tags seem to be completely ignored, and the header and footer are printed as parts of the whole document... i.e. The header is at the TOP of the 1st page, and the footer is at the end of the x page, not on every page, as is represented by StarOffice.

Using a DLL Spy, i can see that StarOffice is using MSHTML.DLL

Is this the DLL that allows StarOffice to use the Header / Footer information?

Here is a snippit of the HTML code being used.

&lt;DIV TYPE=HEADER&gt;
&lt;TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=0&gt;
&lt;COL WIDTH=181*&gt;
&lt;COL WIDTH=75*&gt;
&lt;THEAD&gt;
&lt;TR VALIGN=TOP&gt;
.... etc etc etc

&lt;DIV TYPE=FOOTER&gt;
&lt;TABLE WIDTH=100% BORDER=1 CELLPADDING=0 CELLSPACING=0&gt;
&lt;TR VALIGN=TOP&gt;
&lt;TD&gt;

..... etc etc etc..

Any help would be greatly apperciated.

Printing HTML File
Hi.
My application opens up a HTML file and writes a srting to it. Does anyone know the command to print the contents of the HTML file to the printer.

My code is:
Dim ff As Integer
ff = FreeFile
Open App.Path & "" & "myFile.html" For Output As ff
Print #ff, sFrag ' Send the string to the file

' Now I need to print the HTML file to the printer.

Thanks,
D

Printing HTML String
Hi.
I have a string called sFrag that contain HTML code of the form
sFrag = " <TABLE> <TR> <B> Hello World ........ <TABLE> "

I need this to be printed to the printer in its table format. But when I try Printer.Print sFrag it just prints the characters and text (and not in the table format I want)

Any ideas of how to print it so it's in its nice formatted Table HTML format.


Anyway, thanks for the help,

D

Printing An HTML File From VB
Is there any way that I could print an HTML file directly from within VB?

I have HTML reports generated from within my database and sored in a specified location. eg "C:
eports"

I then have a FileListBox on a separate form which list the html files located within the this folder,user unable to change folder loaction.
I would then like to be able to allow the user to select a file, from the list, this I have no problem with, and then, on a press of a button, get the report printed to the default printer.

Any help would be most appriciated

Printing Html Page From Vb
Hello
is there any way in vb to control Html page printing?
is there any ready made ocx or something ?
thanks

HTML Page Printing
Hi all, i have developed a small app that generate several HTML pages. My intent is to merge all HTML pages in one single document and then send to the printer.

I was wondering if there is any way to grab the WebBrowser content to an image such a bitmap and then send to the Printer object ?

thanks in advance

coloq

Printing An HTML File With VB
I need to open and print a HTML file in the Application directory from VB. I've search the forum for a while now and the closes piece of code that I've found is this...

WebBrowser1.Navigate App.Path & " est.html"
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DODEFAULT


Which I found here...
http://www.xtremevbtalk.com/showthre...ighlight=print


My problem is that I have no idea how to use the WebBrowser Object and I can't find a thread that gives me advice. Right now the error I'm getting when I run that code is "Object Required." Do I need to include a component or a reference? Or should I "Dim Webbrowser1 As Webbrowser"?

Thanks for all your help.

Printing HTML Output From VB 6.0
Hi Guys

Is there a way to print the HTML output from the VB 6.0 application. Assuming that the file is in the html format.

Consider the following simple html file

Code:
<html>
<head>
<title>Test</title>
</head>
<boby>
<h1>TEST PAGE</h1>
</body>
</html>



I should be able to print this html output not the file content actually. So that the output should contain the text "TEST PAGE" with applied header font. Can anyone suggest me to accomplish the above requirement......

Printing XML Or HTML Page
Hi,

I am using a PDF printer, and I want to print XML/HTML and DOC files to PDF. I know Word provides a COM object to print through VB. I do it like this

Dim w As New Word.Application
Dim doc As Word.Document
w.ActivePrinter = "3-Heights(TM) PDF Producer"
Set doc = w.Application.Documents.Open(Text1.Text)
doc.PrintOut False, , Word.wdPrintAllDocument, Text2.Text, , , , , , , True
doc.Close (False)
w.Quit (False)



Does IE provide a similar method for printing? I have been unable to find any way f doing this.

Thank you

Printing Html Files
Hi,

My vb application writes an html file. I want to know how to program my application so that the html pages is printed (as hardcopy) this file.

VB Learner,
Arun

Printing HTML Files Without IE?
Hello,

My program generates an html file with the results (it's the best way, trust me ), now I would like to be able to print this file without all the IE additions (time/date, page number filename etc.), how can I do this?

Thanks in advance!

Printing HTML Pages
I'm using a shell function to mshtml.dll Printhtml,[filename] to print some HTML files that my program make, but, with some systems, I'm having problems...

Also, I don't want to Internet Explorer asks me wich printer should I use...

Someone knows some alternative way to print a HTML page?

Printing HTML Code
I want to print HTML code passed to a function as parameter. When I use "printer.Print" to
print it gives the html code in the print, but I want the output like we see on the internet
browser to be printer. I m passing the HTML code to VB function to keep the formatting intact.

Thanks.

Printing HTML Pages Using VB 6.0
Hi...

I have a set of HTML files saved in a folder.

I want to print all of these HTML files, in a single attempt, using VB application. How do I do this???

As long as the HTML files are being spooled to the printer, I want to display a busy icon. How do I do this???

Kindly help me out at the earliest.

Pravvu

Printing A Html- Prob
hi

From VB, i am converting a word file in to html pages. each word page in each html file.

like

ObjwordTarget.ActiveDocument.SaveAs filename:=file1.htm fileFormat:=wdFormatHTML

after saving this html files. i open the HTML in IE. and click print. its print 2 pages instead 1 page. the first page contain first headings and second page print remaing text in a HTML Page.

i want to print in a single page.

how to resolve the prob?

Thanks
bala

HTML Printing Problem
I have a vb6 application with functionality that includes creating and printing html documents. I was using Internet Explorer (shdocvw.dll) to do the printing but the requirements have changed and now we must include a header and footer on every page.

We have just tried Crystal Reports; however, CR doesn't handle all of the html tags we use (not even tables!) Does anyone know of a tool out there that will allow us to print html with custom headers/footers or perhaps even a way to make it work with IE?

Thanks,

pjp

Printing Html Code As Web Page
how can I print html code as it looks in internet exploer using VB
for example.. the text has following html code

Code:
< html >
<body>
< b >hello! how are you !!! < /b >
</body>
< /html >
vb supposes to send/ print following hello! how are you !!! in bold. to a printer

Opening HTML Document In IE And Printing
Is there any way I can (e.g. using API calls) open a custom HTML document (local file) in IE, make IE print the page and then close IE again?

I would be mose grateful if someone could give me some sample code. If not for all, then for just to solve part of the problem.

I know I can use ShellExecute to open IE, but that's actually as far as I can get.

Thank you in advance

Printing HTML Page Programatically
hi,

is there any way to print html page programatically. i've used startdoc api but of no result.

thanks.

Printing HTML File Programatically
Hi,

I am saving a vsflexgrid in html file (atlast) and now i need to print it after that, i.e, print html file.

Any idea.

PS: shellexecute is not working.

Thanks.

Printing A Pyramid In VBScript/HTML
Hello

I started a special project for someone. He wants to print out a pyramid. Here is my print function:

Code:
function print()
    Dim i, iTop, iLeft
    Dim iY
    iY = 1
    iTop=iTop-40

    for i = 1 to 15 'nbTab
        If i = iY Then
            iTop=iTop+100
            iY=iY*2
        End If
        
        Select Case i
            Case 1:iLeft=1400
            
            Case 2:iLeft=600
            Case 3:iLeft=2200
            
            Case 4:iLeft=200
            Case 5:iLeft=1000
            Case 6:iLeft=1800
            Case 7:iLeft=2600
            
            Case 8:iLeft=0
            Case 9:iLeft=400
            Case 10:iLeft=800
            Case 11:iLeft=1200
            Case 12:iLeft=1600
            Case 13:iLeft=2000
            Case 14:iLeft=2400
            Case 15:iLeft=2800
        End Select

        document.getElementById("shema").innerHTML = document.getElementById("shema").innerHTML & "<table style=""position:absolute;top:" & iTop & "px;left:" & iLeft & "px;"" border=1><tr><td colspan=7> </td><td>" & tableau(i,1) & "</td><td colspan=7> </td></tr><tr><td colspan=3> </td><td>" & tableau(i,2) & "</td><td colspan=7> </td><td>" & tableau(i,3) & "</td><td colspan=3> </td></tr><tr><td> </td><td>" & tableau(i,4) & "</td><td colspan=3> </td><td>" & tableau(i,5) & "</td><td colspan=3> </td><td>" & tableau(i,6) & "</td><td colspan=3> </td><td>" & tableau(i,7) & "</td><td> </td></tr><tr><td>" & tableau(i,8) & "</td><td> </td><td>" & tableau(i,9) & "</td><td> </td><td>" & tableau(i,10) & "</td><td> </td><td>" & tableau(i,11) & "</td><td> </td><td>" & tableau(i,12) & "</td><td> </td><td>" & tableau(i,13) & "</td><td> </td><td>" & tableau(i,14) & "</td><td> </td><td>" & tableau(i,15) & "</td></tr></table>" & vbcrlf & vbcrlf
    next
end function


In this case, I know that there is 15 blocks to my pyramid, so I manually calculated the left position of my blocks

        Select Case i
            Case 1:iLeft=1400
            
            Case 2:iLeft=600
            Case 3:iLeft=2200
            
            Case 4:iLeft=200
            Case 5:iLeft=1000
            Case 6:iLeft=1800
            Case 7:iLeft=2600
            
            Case 8:iLeft=0
            Case 9:iLeft=400
            Case 10:iLeft=800
            Case 11:iLeft=1200
            Case 12:iLeft=1600
            Case 13:iLeft=2000
            Case 14:iLeft=2400
            Case 15:iLeft=2800
        End Select

But if I have 31 blocks, I will need this piece of code:

        'Select Case i
        '    Case 1:iLeft=3000
            
        '    Case 2:iLeft=1400
        '    Case 3:iLeft=4600
            
        '    Case 4:iLeft=600
        '    Case 5:iLeft=2200
        '    Case 6:iLeft=3800
        '    Case 7:iLeft=5400
            
        '    Case 8:iLeft=200
        '    Case 9:iLeft=1000
        '    Case 10:iLeft=1800
        '    Case 11:iLeft=2600
        '    Case 12:iLeft=3400
        '    Case 13:iLeft=4200
        '    Case 14:iLeft=5000
        '    Case 15:iLeft=5800
        
        '    Case 16:iLeft=0
        '    Case 17:iLeft=400
        '    Case 18:iLeft=800
        '    Case 19:iLeft=1200
        '    Case 20:iLeft=1600
        '    Case 21:iLeft=2000
        '    Case 22:iLeft=2400
        '    Case 23:iLeft=2800
        '    Case 24:iLeft=3200
        '    Case 25:iLeft=3600
        '    Case 26:iLeft=4000
        '    Case 27:iLeft=4400
        '    Case 28:iLeft=4800
        '    Case 29:iLeft=5200
        '    Case 30:iLeft=5600
        '    Case 31:iLeft=6000
        'End Select

So how can I write a generic function that calculate my left positions....

Printing HTML Files With Webbrowser
How can you print an HTML file in the web browser control and programatically change the printer settings
e.g. page size = legal

Printing HTML File Directely From VB
I want to print an HTML File directely from VB Application.That is i have a print button in application,if i press that button a html file should be printed.I tried using shell command,but the html file's source code is getting printed.I think we can do this using INTERNET EXPLORER OBJECT.Please give me one suggestion

Printing HTML File From VB Program
Ok, I have generated an HTML file. Now, I need to print the file (not the contents, but the actual HTML file as it appears in the browser, but I do not want to open the browser). Does anyone know how to do this?

I want the file to automatically print with no user intervention.

I do not want the HTML file (browser) to open either.

Thanks for any suggestions,
Greg

Please Help. Printing {html Formated Mail From Outlook}
I have a strange problem but I'm sure someone can help. I use a button in Access to generate an email in Outlook. I use the HTMLBody so that I can have different font colors etc. It works fine. However, if I print it out before I send the email, it prints out portrait (great) but doesn't look like an email, ie. no To: header etc. If I send and then print, it looks like an email but always prints out landscape no matter where I change the setting. I'm assuming its the HTML that is doing it. I have tried putting everything in a one cell table at 60% width, which works as far as the looks of the email, but still prints landscape with half the page blank. What can I do??????????

Question On Printing An HTML Table Generated By VB
Hi all,

I have a print report button that calls Internet Explorer, and writes and HTML Table to the page. I use this method, because it's fast and easy to code, and the cells and rows are dynamic.

Before I selected "Print background colors and images" in Tools/Internet Options/Advanced, the cell borders would print great, however the black separator bars would not print. After I selected it, the separator bars print great, but the cell borders are hardly visible.

The separator bars are simply cells that span all 4 columns, have bgcolor set to 000000 and have &nbsp; as data. The table itself has a border of 1.

Is there any way to get both to print?

Any help is greatly appreciated.

Printing A Remote HTML File ( Not The Source )
I would like to print an html file. Not it's source... but as the browser sees it.

I can use the following code to print the html source. But cannot figure out how to print it in the browser mode.

URL = "http://www.somesite.com/"

Printer.Print Inet1.OpenURL(URL)

Printing An HTML Page From A Webbrowser Control
I'm creating reports for my program, and the way I do it now looks crappy. It works, but I could generate HTML reports and have more flexability. Then I could preview this in a webbrowser and print it off. But how would I do that? (Print...not generate the HTML)

Printing Html Form Without User Intervention
hello guys,
I have used an html doc as a second form in my VB6 prj ,using web Browser control. i want to print this html from my first form.
I call the second form from my first form like
load form1
In the second form , it is like

Private Sub Form_Activate()
Dim hwnd As Long
Form1.WebBrowser1.SetFocus
hwnd = GetFocus
SetFocusToBrowser (hwnd)

SendKeys "^p" 'CTRL+P to print

'SendKeys "{ENTER}"
End Sub

Private Sub Form_Load()
Dim MyHTMLFile As String
MyHTMLFile = App.Path & "ex.html"
WebBrowser1.Navigate (MyHTMLFile)

End Sub
the required API's r in the module.
My problem is that when the form shows the html form ,it shows the print dialog box & user has to press enter to print. is it possible that the form prints without any user intervention ?
thanks.

Printing Multiple HTML-Documents Using WEbBrowser Control
Hello !

Iīve got the following problem. In a VB-Program ( Version 6 ) I need to print multiple HTML and XML-Documents.

This should happen in a loop above the desired documents ( all available on harddisk !) . But there are a lot of problems using the webbrowser control. only one object of the control is instantiated cause the loop can contain up to 10000 documents , so that an initialize of one Browser-control for each doc will soon stop the computer from doing anything.
In this loop I navigate to the doc then give the execwb OLECMDID_PRINT.. command... wait for Readystate = READYSTATE_COMPLETE close the document and walk to the next document...
But it doesnīt work. Not every document is printed or the Explorer is closed before all docs are printed or no doc is printed .... and so on..

I know that the browser creates a second process to print the doc , so I tried it with waiting 1st for the message IE_DocumentComplete and the win_onafterprint. but still the docs are not printed out correctly .
When I implement a For-NExt-Loop before processing the next doc , sometimes all docs are done well... but only sometimes.

I īm glad to hear about any solution for this problem. I donīt prefer a solution in VB , if you know any ActiveX component that can print either HTML as XML , please tell me.

Waiting for your answers ;-))

C...

Problems Printing ActiveX Control On HTML Page
I have an OCX that once embedded in an HTML page only prints the default values in the form. Is there a way to print the current OCX including changes made from the Browser? Basically doing a File -> Print from IE.

Printing A Recordset Passed From Visual Basic Into A HTML Page
Hi,

Can any one of you give me a solution for printing a database recordset which is passed from Visual Basic to a HTML Page. Now i am using FileSystemObject and writing the HTML File and then using a WebBrowser Control navigating to the thus created file. This is a tedious process. Can anyone of you give a much simpler solution for this.

Thanks in Advance...............

 

How To Eleminate Realative Path While Printing From Html (Browser)document WebBrowser
guys .. i m using webBrowser Ctrl in my vb6 application ...when i take print of the loaded document in the ctrl, the realtive path of the loaded document also get printed .. i want to eleminate this path ... any idea abt it. how to do it....
thanks.

How To Shade Between Cells In HTML, I Am Creating Report In Html From Vb6 ! Attached
Hi,

I need a help in shading between cells in my report which i prepar in HTML. Here with this post i attached my project in a Zip file, the database is also in the same Directory. You can open and run the project named Scheduler.vbp inside the Folder Sheduler. It will work. The path for database is already assigned.

1. Run the Project, in the main Form u can see the "Forecast Shutdown" Button & Click it. U will see the Form where i generate report. Just click the report button to see the report in the Internet Explorer, because all values are given default.

2. What i require is, the final look of my html report will be as similar to the scd.bmp in Sheduler Folder. You can see the shade starts from middle of one cell & ends in the middle of the next cell.

I populated data from table and the work is completed except the shade similar to the scd.bmp

3. Now i am changing the background color only. But i need to shade as it is in the scd.bmp.

The shade is given based on 3 fields, you see the Field name in the Report heading.

1. T&I ETS as per OSPAS (Shade should start from this date)
2. D-OFF STRM (Adding this value to StartDate the shade should end)

I posted this question in some Forums, i get some replies, but i am not able to solve the issue.
the link follows

http://www.htmlforums.com/showthread...172#post432172

http://www.siteexperts.com/forums/vi...=17282&start=4

http://www.siteexperts.com/forums/vi...d=18336&Sort=0

http://forum.java.sun.com/thread.jsp...004753#4004753

It will be much helpful if i get help & solved this, bcause my contract ends (Dec 15th).


Instead of giving ideas, it wouldl be better if you given me the solution by modifiying the code. Because i got some suggestions and i tried them & it didn't work out & some suggestions i can't use and see because of not having proper knowledge in the specified area. The project is also there. So it will be more helpful if u give me the solution. Hope the one who works with web development & Vb6 can give me a solution.

Thankyou,
Chock.

Three Objects For HTML Via VB 6 (Inet, WebBrowser && HTML) GET META && InnerText
Dear Fellows,

I have few issues in the HTML.

WebBrowser (control):
I am using the WebBrowser component to receive the HTML of web pages, but:
The InnerHTML returning INSIDE the <BODY> (the body tag not includes).
The OuterHTML returning from the <BODY>.


Inet (control):
Or else I am using the Inet component to retrieve the HTML and it dose get it all (with the meta).
I have browse the Inet object to get the InnerText, I haven’t found.
 
I NEED TO GET THE META OBJECT.
I NEED TO GET THE InnerText.

I don’t want to mix with the two objects in order to receive both (Meta & InnerText)

I have started to develop a function that will CONVERT the HTML to TEXT.
I am sure that it dose exist out there.
I AM LOOKING FOR THIS OBJECT (that can be one help)
Note: the conversion of the html should get the html with the tags and the “&”marks (&amp; = “&” or &gt; = “>” etc…) [I don’t know the official naming for them].

Some web pages have redirect when you type one address in the address bar and you get the second one as a result, I need the object to get it too.

Main Question:
1.    how do I get (which object) all the HTML, within it the Title & META and the InnerText of a web page.
I need that object to get me the redirect of URL.


Best regards & thank your 4 using VbCity,
Isaac

HTML Interaction With VB6 Apps And HTML Embedding With Custom Names.
Part 1: HTML Interaction

Visit this MSDN Article on. Very necessary that you know this!!!

Registering an Application to a URL Protocol

Create a new Standard EXE VB6 project and Add the Microsoft Internet Controls component from the Components menu.
Now draw a WebBrowser control on the form.

In the properties window, change the LinkMode of the Form to 1-Source and let the LinkTopic be as it is.
Open the Code View for Form 1 and in the LinkExecute event handler for Form1, add the following code:

Code:WebBrowser1.Navigate2(Mid$(CmdStr,6,Len(CmdStr) - 5))

Now, compile the program into Say... Project1.exe in C:
As said in the MSDN Article, let us now register our application to a URL Protocol. To do this I will customise the Example shown there

[HKEY_CLASSES_ROOT]
    [note]
        (Default) = "URL:Note Protocol"
        URL Protocol = ""
        [shell]
            [open]
                [command]
                    (Default)= "c:Project1.exe"
        [DDEEXEC]
         (Default)= "%1"
        [Application]
         (Default)= "Project1"
        [Topic]
         (Default)= "Form1"

Now, open IE and type the following (assumption: a sample HTML file in "C:" called "test.htm")
note:C: est.htm

And Viola! Your app opens with the page displayed in the WebBrowser control.

Now, try adding a hyperlink into the sample html file with a "href=note:C: est2.htm" and see what happens.

-------------------------------------------------------------------------------------------------------------

Part 2: Embedding Custom HTML resources in programs and accessing using res protocol

Now, to embed a HTML into a VB6 program, Use Resource Editor AddIn in VB6 to add a resource file to your app. Add a custom resource say a HTML file. It is added to the ResEdit as 101.
Now right click and say properties. Now change the Type to HTML and Id to
say...index.htm.

Save the file and compile the project. Now open IE and type res://[path ()
and name of the compiled file]/HTML/index.htm.

You will see the file. Same way embed a GIF or JPG and try the same
technique, even script and css files. It should work.

These two techniques will help you embed HTML resources in programs and make them talk to your application. I am still not sure as to how to add forms in HTML to post data to the app. Anyone here can be brainy to figure out that! Also, please do post possible usefulness of these techniques. I can suggest developing apps like MS Money 2000, Outlook Express, etc...

If you have further questions or any problems. Please mail me at mark23tx@lycos.com

Copyright Đ 2005-08 www.BigResource.com, All rights reserved