Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print a table

Status
Not open for further replies.

sohjai

Programmer
Nov 23, 2001
8
HK
Hi everyone, I am new in VB and I would like to know how to print a 4*3 table using the printer object?
 
Code:
Dim LCV1 As Integer
Dim LCV2 As Integer
Dim MyArray(1 To 4, 1 To 3) As Long
Dim PrintLine As String

'Load The array
For LCV1 = 1 To 4 Step 1
   For LCV2 = 1 To 3 Step 1
      MyArray(LCV1, LCV2) = LCV1 * LCV2
   Next
Next

PrintLine = ""
For LCV1 = 1 To 4 Step 1
   For LCV2 = 1 To 3 Step 1
      PrintLine = PrintLine & MyArray(LCV1, LCV2) & Space(5)
   Next
   Printer.Print PrintLine
   PrintLine = ""
Next
Printer.EndDoc

This is very generic... I hope it is what you're looking for!

Brian
 
Actually I want to print the border of the table(using the printer object to draw the table), so how can I do that?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top