CommonDialog1.ShowPrinter Help
CommonDialog1.ShowPrinter Help
(OP)
I don't know what to put in for green text. What code do I use to send to the printer.
Thank You in advance!!
CODE
Private Sub Command1_Click ()
Dim BeginPage, EndPage, NumCopies, Orientation, i
' Set Cancel to True.
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
' Display the Print dialog box.
CommonDialog1.ShowPrinter
' Get user-selected values from the dialog box.
BeginPage = CommonDialog1.FromPage
EndPage = CommonDialog1.ToPage
NumCopies = CommonDialog1.Copies
Orientation = CommonDialog1.Orientation
For i = 1 to NumCopies
' Put code here to send data to your printer.
Next
Exit Sub
ErrHandler:
' User pressed Cancel button.
Exit Sub
End Sub
Dim BeginPage, EndPage, NumCopies, Orientation, i
' Set Cancel to True.
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
' Display the Print dialog box.
CommonDialog1.ShowPrinter
' Get user-selected values from the dialog box.
BeginPage = CommonDialog1.FromPage
EndPage = CommonDialog1.ToPage
NumCopies = CommonDialog1.Copies
Orientation = CommonDialog1.Orientation
For i = 1 to NumCopies
' Put code here to send data to your printer.
Next
Exit Sub
ErrHandler:
' User pressed Cancel button.
Exit Sub
End Sub





RE: CommonDialog1.ShowPrinter Help
printer.print "Copy Number = ";i 'prints copy number
printer.print.me 'prints the current form
'print a calculation
Printer.Print("Total (" & (19 + 300) / 4 & ")")
'prints "Total (79.75)"
printer.print "Goodby"
printer.enddoc 'dumps the page to the printer
**********************
"The problem isn't working out the equation,
its finding the answer to the real question." BigInch
http://virtualpipeline.spaces.live.com/
RE: CommonDialog1.ShowPrinter Help
I diden't express my problem correctly.
I am trying to get VB to print the document I have already have open on my screen. (.doc, .xls, .dwg, .slddrw) I have the printer printing by the pages come out blank.
Any Ideas ?
RE: CommonDialog1.ShowPrinter Help
Not really. I've never had the occasion to print a document opened by VB using another application. I would suspect that you have to refer to that document in the same manner in which you opened it in VB. Maybe something like, Printer.Print Excel_whatever, but sorry, I really don't know.
**********************
"The problem isn't working out the equation,
its finding the answer to the real question." BigInch
http://virtualpipeline.spaces.live.com/
RE: CommonDialog1.ShowPrinter Help
http://visualbasic-source-code.com/visual-basic-6/