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
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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!
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
<font color=red>hahaha</font>
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.
HTML Help Workshop: Html Files Without Images
Hi,
I've done many html page with text and image.
Then I've created an help guidi with "HTML Help Workshop".
The matter is that I've an help file with text but Without images.
Why the compiler doesn't save images to the final file?
As a result of compile run is:
Compiling c:LavoriSCGuida.chm
Compile time: 0 minutes, 1 second
17 Topics
32 Local links
0 Internet links
0 Graphics <--- why is this zero?
Created c:LavoriSCGuida.chm, 10,595 bytes
Compression increased file by 10,279 bytes.
thanx in advance
*** Resolved*** Saving MS Word Files As HTML Files Via VB
i'm trying to save a word document as HTML via VB
i'm using this
wordobj.ActiveDocument.SaveAs ("c:clutter tempMediapix.html"), 108, False, "", True, "", False, False, False, False, False
where 108 is the vb code for word html (i think)
but when i run it i get an error saying that the command could not complete...
any suggestions??
Do You Know A Smart System To Convert HTML Files In PDF Files???
Hi my dear friends,
Sometimes I return here to ask a question...
I developed an intranet web site in which the users can generate HTML files. Due to a migration to a new system, the requirement is to get all these HTML files and convert them to PDF format, because the new system doesn't support HTML files.
I made a search on the net about this issue, and there is a lot of converters, but the problem is that I'd need to use only the technologies that are already installed, because the customer doesn't want to spend money in new third part software.
I'm wondering if it's possible to create a VB6 application that reads all the HTML files from a folder (path included, because I have to manage also subfolders) and convert them into PDF files. It doesn't matter if the process is so long, I can schedule it at night.
Any idea or suggestion will be appreciated.
Cheers and good weekend to all,
Laura
Try to teach something to someone, and you'll learn more than you expect of yourself!
Read Articles and Resources By Rock: This page contains links to several articles collected over time here at VbCity
Edited by - laurarana on 5/21/2007 3:16:26 AM
Producing MHT (web Archive) Files From HTML Files
Does anyone know how to programatically generate an MHT (web archive, single file) file from an HTML file via VB 6.0? I am generating an HTML file using the "Print #1, strHTMLOutput" method, but once, generated I would like to have that file archived into a single file so that any referenced images don't need copying as seperate files to a target machine...
Many thanks in advance.
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"
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?
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.
<DIV TYPE=HEADER>
<TABLE WIDTH=100% BORDER=0 CELLPADDING=4 CELLSPACING=0>
<COL WIDTH=181*>
<COL WIDTH=75*>
<THEAD>
<TR VALIGN=TOP>
.... etc etc etc
<DIV TYPE=FOOTER>
<TABLE WIDTH=100% BORDER=1 CELLPADDING=0 CELLSPACING=0>
<TR VALIGN=TOP>
<TD>
..... 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 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 Multiple MSWord Files. Files Do Not Print In The Same Order As Instructed By Code
I am printing multiple Word files from VB using the code indicated below. The order in which they come out of the printer is not the same as that followed by the code.
What can I do to get them to come out of the printer in the same exact order as executed by the code.
Code Used:
For nI = 0 to n
sFile = "File" & Trim(Str(nI)) & ".doc"
Documents.Open FileName:=sFile, ConfirmConversions:=False, ReadOnly:=
True, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="" , Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="",
Format:=wdOpenFormatAuto
ActiveDocument.PrintOut Range
:=wdPrintAllDocument, Item:=wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, Collate:=True, Background:=True, PrintToFile
:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0,
PrintZoomPaperHeight:=0
Documents.Close
Next
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 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 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 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.
|