Print Column Header On Each Print Out Page
I am trying to put the header of each column on each print out page. Right now I have it only appearing on the first page of my printouts.
How do you do that in Excel 2003?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Print Listview Column Header
I would like to know, How I can print listview column header? I cannot print the column header. Why? what wrong with this code?
Code:
'column header
For i = 1 To Form5.ListView2.ColumnHeaders.Count
Printer.Print Tab(5); Form5.ListView2.ColumnHeaders(1); _
Tab(25); Form5.ListView2.ColumnHeaders(2); _
Tab(45); Form5.ListView2.ColumnHeaders(3); _
Tab(65); Form5.ListView2.ColumnHeaders(4); _
Tab(85); Form5.ListView2.ColumnHeaders(5); _
Tab(105); Form5.ListView2.ColumnHeaders(6); _
Tab(125); Form5.ListView2.ColumnHeaders(7); _
Tab(145); Form5.ListView2.ColumnHeaders(8);
Next
Mshflexgrid Column Header Print
I search the forum but still unresolved this problem
my code for print is this but withoutcolumn header :
VB Code:
Private Sub cmdPrint_Click() Dim i As Integer Dim J As Integer Dim PTab As Integer Printer.Orientation = vbPRORLandscape Printer.Print Printer.Print Me.Label1 Printer.Print Me.Label2 Printer.Print Me.Label3 Printer.Print Date & " " & Time Printer.Print "- - - - - - - - - - - - - - - - - - - - - - - - - -" For i = MSHFlexGrid1.FixedRows To MSHFlexGrid1.Rows - 1 PTab = 10 'Set the first tab value 'This checks to see if a page break is needed 'If Printer.CurrentY + Printer.TextHeight(gridQuery.Text) > Printer.ScaleHeight - 600 Then ' Printer.NewPage 'End If On Error Resume Next MSHFlexGrid1.Row = i On Error GoTo 0 For J = MSHFlexGrid1.FixedCols To MSHFlexGrid1.Cols - 1 MSHFlexGrid1.Col = J 'Send the field to the print line and add the tab. 'Notice the semicolon at the end of the line. Printer.Print Trim$(MSHFlexGrid1.Text); Tab(PTab); PTab = PTab + 30 'Increment the tab value Next Printer.Print Next Printer.Print Tab(18); "- - - - - - - - - - - - - -" Printer.EndDocEnd Sub
thanks
anyone help me out is greatly appreciate
best regards
How To Print Group Header Into Every New Page
Hi There,
Is there a way that I can make sure that the group heading is printed on
every page that has records to do with the group?
I.e. I have a group of records that's span over several pages. The group
heading appears only before the group (on the first page), however it is
required that the group heading appears at the top of the other pages.
Any ideas?
Print Column Headings On Each Page In VB
I am printing a data report from VB6. On each page, I want to print the same description, data, constant parameters and column heading. I do not want to use the Header funtion because it seems to be so complicated. So I tried this code:
PrintHeading:
iPageNumber = Printer.Page
'print heading here
For i = iCurrentData to uBound(strData)
printer.Print 'go to next line
'try to print heading if next page
if Printer.Page > iPageNumber then
iCurrentData = i
iPageNumber = Printer.Page
GoTo PrintHeading
'print data here
Printer.Print strdata(i)
Next i
Here is my problem: Every time it starts a new page (not including the first page), it prints the first data on that page BEFORE it prints the heading. How should I debug?
Jeff
Can Data Report Print Two Column In One Page
Subject: Can Data report print two column data in one page
Category: ActiveX
Here I have a question. In Data report, Can I print data in two column like the following report
Page 1
```ID```COL2```-|```ID```COL2```
```1```A````````````-|```10```K```````
.....
```9```J`````````````-|```19```U```````
Page 2
```ID```COL2```-|```ID```COL2```
```20```V``````````-|```30```AA```````
....
If Datareport , cannto do it, what about crystal report?
Best regard
wky086
Problem With Print, Page Setup, And Print Preview In A Text Editor...
Yes, I have another question.
When I use these exact same functions (with WebBrowser.ExecWB in place of txtScrapbook.Text) in my web browser, it works perfectly. But when I use them in reference to a text box, it doesn't.
Can you tell me where the problem lies, or give me an alternative method? I have a common dialog box already for other functions, so feel free to make use of it if you need to. Thanks.
Code:Private Sub PageSetup_Click()
txtScrapbook.Text OLECMDID_PAGESETUP, OLECMDEXECOPT_DODEFAULT
'opens page setup dialog
End Sub
Private Sub Print_Click()
txtScrapbook.Text OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER
'opens common dialog box prompting user to print current web page/parts of current web page
End Sub
Private Sub PrintPreview_Click()
txtScrapbook.Text OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_DODEFAULT
'opens print preview dialog
End Sub
How To Print Images That Fit To The Page Size Specified In Print Common Dialog?
i need some help in printing the whole image tat fit onto the paper size i specified in Print Common Dialog. I hav a PictureBox array & each PictureBox contains a smaller Picturebox inside. For example : Picture1(index) has a smaller Picture2(index) inside. There are vertical & horizontal scrollbars next to each Picture1(index).
i already hav the basic Print Common Dialog code below. Here's the problem -> I can print out the pictures displayed inside Picture2(index) but the printout will turn out truncated or just part of the whole picture when im printing to a 4R photo size for example and the image displayed in Picture2(index) is larger then the bounding Picture1(index) & i need to use the scrollbars to scroll and view the other portions of the image.
So how to modify the code below to print out the whole image tat fit nicely to the paper size i specified. Thanxs.
'---------------------------------------------------------------------
'CODE
'---------------------------------------------------------------------
CommonDialog1.CancelError = True
On Error Resume Next
CommonDialog1.Action = 5 ' Start the Print Common Dialog
If (Err.Number = cdlCancel) Then Exit Sub
'when Cancel is pressed, exit subroutine
'Code to print the array here
For Pics = Picture2.LBound To Picture2.UBound
If Picture2(Pics).Picture > 0 Then ' If the PictureBox is not empty
Printer.PaintPicture Picture2(Pics).Picture, 0, 0
Printer.EndDoc
End If
Next
'---------------------------------------------------------------------
Print Picture Box (print A Form That Is Too Large For The Screen Or Page)
I got a picture box (Picture1), which contain several picture box'es, labels and
Flex Grid tables, -which I would like to print. Picture1 is quite high (higher than the screen). I found some code that i modified, but the printing only get the labels proper. The Flex Grids and picture box'es only show the border, and not the contents.
Code:Private Const WM_PAINT = &HF
Private Const WM_PRINT = &H317
Private Const PRF_CLIENT = &H4& ' Draw the window's client area.
Private Const PRF_CHILDREN = &H10& ' Draw all visible child windows.
Private Const PRF_OWNED = &H20& ' Draw all owned windows.
Private Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long
Private Sub Print_Click()
Dim rv As Long
Me.ScaleMode = vbTwips ' default
With Picture2
.Top = Picture1.Top
.Left = Picture1.Left
.Width = Picture1.Width
.Height = Picture1.Height
End With
Me.Visible = True
DoEvents
Picture1.SetFocus
Picture2.AutoRedraw = True
rv = SendMessage(Picture1.hwnd, WM_PAINT, Picture2.hDC, 0)
rv = SendMessage(Picture1.hwnd, WM_PRINT, Picture2.hDC, _
PRF_CHILDREN + PRF_CLIENT + PRF_OWNED)
Picture2.Picture = Picture2.Image
Picture2.AutoRedraw = False
Printer.Print ""
Printer.PaintPicture Picture2.Picture, 0, 0
Printer.EndDoc
End Sub
Edited by - Zigar on 11/27/2003 3:31:21 AM
HELP Print Listview Print To Many Page
HI
I am using this to print Listview
When I print 1 page then it is ok but
if data from Listview go on 3 or 4 page then fyrst page is ok
efter fyrst page I only get 1 data on on each page
so this can be many page
Can somone help me what is wrong in this ??
Printer.Font = "Tahoma"
Printer.FontBold = True
Printer.FontUnderline = False
Printer.FontSize = 10
Printer.Print "Print from listview"
Printer.FontUnderline = False
Printer.Print vbNewLine
Printer.CurrentX = 1440
Printer.CurrentY = 1440
PrintListView lvwDataCopy
Printer.EndDoc
Private Sub PrintListView(lvw As ListView)
Const Margin = 60
Const COL_MARGIN = 240
Dim ymin As Single
Dim ymax As Single
Dim xmin As Single
Dim xmax As Single
Dim num_cols As Integer
Dim column_header As ColumnHeader
Dim list_item As ListItem
Dim i As Integer
Dim num_subitems As Integer
Dim col_wid() As Single
Dim X As Single
Dim y As Single
Dim line_hgt As Single
xmin = Printer.CurrentX
ymin = Printer.CurrentY
' ******************
' Get column widths.
num_cols = lvw.ColumnHeaders.Count
ReDim col_wid(1 To num_cols)
' Check the column headers.
For i = 1 To num_cols
col_wid(i) = _
Printer.TextWidth(lvw.ColumnHeaders(i).Text)
Next i
' Check the items.
num_subitems = num_cols - 1
For Each list_item In lvw.ListItems
' Check the item.
If col_wid(1) < Printer.TextWidth(list_item.Text) _
Then _
col_wid(1) = Printer.TextWidth(list_item.Text)
' Check the subitems.
For i = 1 To num_subitems
If col_wid(i + 1) < _
Printer.TextWidth(list_item.SubItems(i)) _
Then _
col_wid(i + 1) = _
Printer.TextWidth(list_item.SubItems(i))
Next i
Next list_item
' Add a column margin.
For i = 1 To num_cols
col_wid(i) = col_wid(i) + COL_MARGIN
Next i
' *************************
' Print the column headers.
Printer.CurrentY = ymin + Margin
Printer.CurrentX = xmin + Margin
X = xmin + Margin
For i = 1 To num_cols
Printer.CurrentX = X
Printer.Print FittedText( _
lvw.ColumnHeaders(i).Text, col_wid(i));
X = X + col_wid(i)
Next i
xmax = X + Margin
Printer.Print
line_hgt = Printer.TextHeight("X")
y = Printer.CurrentY + line_hgt / 2
Printer.Line (xmin, y)-(xmax, y)
y = y + line_hgt / 2
' Print the rows.
num_subitems = num_cols - 1
For Each list_item In lvw.ListItems
X = xmin + Margin
' Print the item.
Printer.CurrentX = X
Printer.CurrentY = y
Printer.Print FittedText( _
list_item.Text, col_wid(1));
X = X + col_wid(1)
' Print the subitems.
For i = 1 To num_subitems
Printer.CurrentX = X
Printer.Print FittedText( _
list_item.SubItems(i), col_wid(i + 1));
X = X + col_wid(i + 1)
Next i
y = y + line_hgt * 1.5
Next list_item
ymax = y
' Draw lines around it all.
Printer.Line (xmin, ymin)-(xmax, ymax), , B
X = xmin + Margin / 2
For i = 1 To num_cols - 1
X = X + col_wid(i)
Printer.Line (X, ymin)-(X, ymax)
Next i
End Sub
Print A Page Without My Print Button!!!
My question concern my web page:
How can i print an html page without it's print button.
I figure out how to hide the button when pressed(with layers)
but when it's finish printing or the user cancel,
how can i make the button visible,i know how but on
what event.
some1 have an idea??
Suppressing A Column On The Page Header
Hi there I am having problems trying to supress blank fields in Crystal 8.5. Here is what happens:
The page header could look like this:
asdflkjasdflkajdfasldj Inc(Vendor Name)
a division of blahblahblah(Address Line 1)
123 X street(Address Line 2)
Candy World, CA 99999(Address Line 3)
or it could look like this
asdfad Inc(VendorName)
123 X Street(Address Line 1)
<This is the blank line I want to suppress> (Address Line 2)
Candy World, CA 99999(Address Line 3)
So if AddressLine2 field is blank I'd like (City, State, Zip Code) to move up. How can I accomplish this with what I have? I am attaching a screen shot of the report, hope this helps. Oh and by the way, I don't want to do it by code.
Print Header
Hi, I'm using VBA to write a macro to generate some data onto an excel worksheet.
i have resized all columns such that everything will fit into the width of 1 A4 size paper. I have a row of headers on Row 1 to name each column. i.e. Col A can be 'Name', Col B can be 'Telephone' etc.
however, they can be like 100 rows of data in the worksheet thus it will stretch to be printed onto 5 sheets of paper.
as such is there a way to program in VBA that allows the headers of Row 1 to appear at the top of each new paper that will be printed?
pls advise.
Re:Print Header On A4 Paper
hi;
i would like to print out the header on the A4 paper.
my problem is i have 2 forms. form1 and form2. there is a Print button on form1, i want to print the content in form2 by using code "PrintForm" to the printer but due to the space of the form2, i couldnt put the header for form2. I had try to use Printer.Print " Header...." to print out the header for content of form2. but the problem is when i click on the Print button, it only print out the header,no content of form2. Who can help me to print out the header and content of form2?
the code i used in form1 is :
Private Sub Print_Click()
Printer.Print "Header...."
Load Form2
Form2.Hide
Form2.PrintForm
Print Word Document Without Header
I want to write a macro to print a word document without the header. It seems that this would be an easy macro to write but I am stumped. You could select the header and make it hidden; print the file and then make the header unhidden. Problem is there is no way to select all the text in the header so that you can format it as hidden. (I want to use the macro with any document.) Any ideas?
RTB - Header/Footer Print Preview
Does anyone have either code or a link that will show me how to create headers/footers when I am printing the contents of a RichText Box?
Thanks
Mark
Print Header And Footer In RichTextBox
I am looking for a way to print file header and footer in Microsoft RichTextBox.
I looked up MSDN and found that header is supported, but when I included that in rtf file and loaded the RichTextBox. It didn't show up.
Is it achievable? If yes, how?
WebBrowser To Print - How Do I Eliminate Header && Footer?
Hello.
I've got a pretty nice looking HTML page for my invoices and by substitution the info for each customer in the HTML code and then printing the page through the WebBrowser, I'm ending up with some pretty nice results.
How do I get rid of the Header and the Footer when I do the
Code:
WebBrowser1.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0
statement?
Data Report (Want To Print Table Contents In Header)
Hello,
I want to print the data retrieved from one field of a table only once in the report header or page header.
Data report is not allowing me to do this.
I have one form with one combobox and textbox. where i take the input from the user for month & year. According to that i show all the entries of that month & year in data report but i want to print the value taken in combobox & textbox in my report at top. eg.
XYZ Company
'January 2004'
only once in header.
Can i do it.
Thaking in anticipation.
Regards.
Data Report (Want To Print Table Contents In Header)
Hello,
I want to print the data retrieved from one field of a table only once in the report header or page header.
Data report is not allowing me to do this.
I have one form with one combobox and textbox. where i take the input from the user for month & year. According to that i show all the entries of that month & year in data report but i want to print the value taken in combobox & textbox in my report at top. eg.
XYZ Company
'January 2004'
only once in header.
Can i do it.
Thaking in anticipation.
Regards.
Print Page That Contains Last Value
Hi,
I am using VB6 to access an excel document. What I want to do is find the last value of a range (a1:a100) and print only the page that the last value appears on.
Example:
Say the last value in that range is in cell a79, and a79 appears on the third page of the file, vb6 now only prints page 3 (which contains a79).
I hope that makes sense and that you are able to assist me.
Thanks again.
Daniel.
Page Set Up Before Print
Hi All,
Glad to be the member of this Forum.
Is it possible to make "Page 1 of ?" option as the default footer in Page Set up. That is every I shouldn't be selecting the option before printing.
Please help.
Thanx
Print A A4 Page
I have two fields in my database
They are :name and ID
The original layout is:
Name ID
Tom 1
Mike 2
Jack 3
Allan 4
I would like to print it like:
Name ID Name ID
Tom 1 Jack 3
Mike 2 Allan 4
anyone knows ? thank you !!! thank you !
Keep asking question until the end of the world....
Help Please With 2 Page Print Out.
Ok I am new to VB6 and I ran into a problem. When I print out a report from a text box the report ends up being 2 pages which it is suppose to be, but here is the problem. The first page prints out fine with a top margin of about 1/2 inch, but the second page looses the top margin data and prints the first line of the second page about 2 mm from the top of the page instead of 1/2 inch top margin.
I just want the second page to have the 1/2 top margin also what do I need to do?
here is my code so far.
Private Sub cmdPrint_Click()
'USE API TO PRINT
If (DisplayPrinter(txtReport.hWnd, centerForm:=True)) Then
Printer.ScaleLeft = -0.5 * 1440 'left margin
Printer.ScaleTop = -0.5 * 1440 'top margin
Printer.CurrentX = 0
Printer.CurrentY = 0
Printer.Font = "ARIAL"
Printer.FontSize = 12
Printer.Print txtReport.Text
Printer.EndDoc
MsgBox "Report has printed successfully."
End If
End Function
any suggestions or code would really be appriciated. Please make it as simple as possiable, since I am really new at vb6 thanks,
Print On New Page
Hello i have 2 questions, my first one is how do i print to my printer?
I think its something like Print.Printer but im not sure.
For my second question: i know that there is a code that when i add it it will print automaticly to a new page on my printer even when the page isnt full yet. I thought it was something like Chr12 to print on a new page but i forgot what it was. Hope anyone can help me out here.
Print New Page
I would like to know, How I can print the picture and put the picture in a new page after print the contents in the listview?
Code:
For i = 1 To ListView1(0).ListItems.Count
Printer.Print Tab(5); ListView1(0).ListItems(i); _
Tab(25); ListView1(0).ListItems(i).ListSubItems(1); _
Tab(45); ListView1(0).ListItems(i).ListSubItems(2); _
Tab(65); ListView1(0).ListItems(i).ListSubItems(3); _
Tab(85); ListView1(0).ListItems(i).ListSubItems(4); _
Tab(105); ListView1(0).ListItems(i).ListSubItems(5); _
Tab(125); ListView1(0).ListItems(i).ListSubItems(6); _
Tab(145); ListView1(0).ListItems(i).ListSubItems(7)
Next
Printer.Print "Legend": ForeColor = vbBlack
Set Picture2 = LoadPicture(App.path & "output.bmp")
Printer.PaintPicture Picture2, 60, 13000, 2000, 800
Printer.EndDoc
Print A Web Page
How to print a web page pogramatically from within Vbcode? (The web page should not appear on the screen ie. it should be loaded in background or in a web control)
Print 1st Page Of PDF
How do I Print the 1st page of a PDF? I currently use:
VB Code:
ShellExecute(hDesktop, "Print", "somefilename.pdf", vbNullString, "C:",0)
but it prints it all when I just want the first page.
thanks
---edit---
the program used Crystal Report Application server, so i just used the export feature to word and used the word application object to print page 1, but thanks for all of the interest.
Help. How To Print More Than 1 Page ?
Hi peeps, i have 2 probs.
Im new and have spent days on this forum learning all that i have learned so far.
THANKS ALL
After much searching i have finally found how to print the contents of my msflexgrid.
I have 2 problems that i am hoping your goodselfs can help with.
1. ) The data i have in the flexgrid is more than 1 page but can not get the rest to print. how can i get the printer to manually feed the next page and continue printing. ??
current code i am using is.
Private Sub Command5_Click()
Printer.ColorMode = vbPRCMMonochrome
Printer.PrintQuality = vbPRPQDraft
Printer.Orientation = vbPRORLandscape
Printer.PaintPicture Grid1.Picture, 0, 0
Printer.EndDoc
End Sub
2. ) Less inportant.
whilst printing the flexgrid, i would like to print in the background my logo so it is like a hologram. ?
Not sure if this can be done with the print command or if it can be included into the msflexgrid as a background image.
Hope you can help.
Thanks.
Print The Web Page
Working with the printer is a pain...
I had an idea to display what I wish to print as a web page in a hidden webbrowswer and the tell that webbrowser to print
webbrowser1.print
but there is not print method
there must be a way!
Print Fit To Page
Hi, I have an Access database and I've created a print button on one of my forms. When I click print it prints on 2 pages and I want to squeeze it onto 1 page. I can do this by adjusting the page setup but I want to do it in the visual basic code somehow so that all the users won't have to change their page setup. I've searched everywhere and can't find an answer to my problem, can someone please help?
Print From A Web Page
Hi,
I have a web site. I have a listing of all the word documents on the web site with a selection box for each. When I select some docs and click Print Button, I need to print all those docs onto a local printer ?
Can I use VB script for that ? If so, how ? Thanks for your help,
Cuteguy141.
How To Print At Last Page
hi......
can anyone please explain how to print the page footer only at the final page in data report (VB 6)
for example,
l've 3 page report n i only want the total of sales print at final page, Page 3 only.
TQ.....
Print First Page Of Doc
I need to change the printer settings in order to print the first page of a pdf file. Here is my print code, what can i do to make it print just the first page.
strPrinterName = Printer.DeviceName
strDriverName = Printer.DriverName
strPortName = Printer.Port
'Perform error checking
strCommandLine = "c:Program FilesAdobeAcrobat4.0 ReaderAcroRd32.exe /t """ + _
strfilename + """ """ + _
strPrinterName + """ """ + _
strDriverName + """ """ + _
strPortName + """"
RunProcess strCommandLine
thanks
JM
Print Web Page
Do u know: how to print a web page? To print it in text format (html codes) and graphic format(like we see in web browser). I have a hard time to figure it here. Could u help? Thanks!!!
How To Print Data To 3 Column
Hi..
I have a problem here
can I print data in Excel in order to print large data into 3 column
Example: If i had 1000 data then the data will be splited into 3 such as:
1 101 201
100 200 301
and so on until it finish
so that the 1000 data can be printed on 4 pages only (300 rows each)
I have tried creating index(macro) for that data but I don't know ho to implement that
anyone can help with an idea or fragment of code?
Thx
Print A Listbox With More Than One Column?
I use this to add columns into my listbox
VB Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const LB_SETTABSTOPS = &H192Private Sub Form_Load()'from an example on [url]http://www.mvps.org/vbnet/index.htm...listboxtabs.htm[/url]'set up the tabstops in the list boxes ReDim TabStop(0 To 2) As Long 'assign some values to the tabs for the second third and fourth 'column (the first is flush against the listbox edge) TabStop(0) = 90 TabStop(1) = 130 TabStop(2) = 185 'clear then set the tabs Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 0&, ByVal 0& Call SendMessage(List1.hwnd, LB_SETTABSTOPS, 3, TabStop(0)) List1.AddItem "Big" & Chr(9) & "Brown" & Chr(9) & "Dog" List1.AddItem "Brown" & Chr(9) & "Big" & Chr(9) & "Dog" List1.AddItem "Dog" & Chr(9) & "Brown" & Chr(9) & "Big" List1.RefreshEnd Sub
But when I try to print out this it dosen't look as straight and nice as it looks in the listbox. Why?
VB Code:
Private Sub Command1_Click()Dim arrDim x As IntegerFor x = 0 To List1.ListCount - 1 arr = Split(List1.List(x), vbTab) Printer.Print arr(0) & vbTab & arr(1) & vbTab & arr(2) Next xPrinter.EndDocEnd Sub
Print Two Forms On One Page
How do I get two forms under the same project to print on a letter size page?
The print button is initialized from Form1 which collects the info. Form2 & 3 are formatted just for printing. This is all a standard exe file.
Any help would be apprciated.
Print Web Page Oddity
IE.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0
This works fine except it will print one extra blank page. When I change it to prompt the user only one page is printed. I removed the header and footer for both and they are the same webpage. Any ideas as to why not prompting the user would result in an extra blank page being printed?
Thanks,
Mark
Print First And Last Page In Excel
I am trying to build a macro in VB to print out only the first and last page of Excel reports that I produce. Is there anything that returns the last page?
Print Page Size Help
i am using printer.print
how do i tell the computer i want to print to Legal size????
Printer.PaperSize
but what is the answer for legal?
How To Print 2 Forms In One Page?
HI my problem is the following
I need to print one form and it´s duplicate in one page. I tried to copy and paste the entire form, but the size exceds the size permited by visual basic 6.
Thanks in advance
Webpage: Print To Fit One Page
Hi,
I have a program that loads a web page into a WebBrowser Control. I can print it fine using the following code:
Code:
wWeb.SetFocus
wWeb.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0
I would like to print the page to fit to one page. I have tried printer.ScaleWidth = 8.5, and tried various printer.zoom values, but nothing works. Does anybody have any ideas?
Ryan
Print Heading Every Page
Hi! I can print a heading only in my first page. How would I print the same heading in every page and how do i print page numbering Like "Page 1 of N". What should be added to my code?
VB Code:
Printer.FontName = "Courier New" Printer.FontSize = 11 Printer.Orientation = vbPRORPortrait Printer.CurrentY = 720 'Top Margin of .5" Printer.Print Tab(60); "Date Printed: "; Date Printer.Print Tab(60); "Served by: "; lblLoginName.Caption Printer.Print Tab(60); "Transaction ID: "; txtTransactionID.Text 'Printer.FontUnderline = True Printer.Print: Printer.Print Dim Pagelength%, BottomMargin%, TopMargin% Pagelength = 11 * 1440 BottomMargin = 1 * 1440 TopMargin = 0.5 * 1440 'Print headers If Printer.CurrentY > Pagelength - BottomMargin Then Printer.NewPage Printer.CurrentY = TopMargin End If
|