Common Dialog and custom printing
Ok so I've got code like this:
VB Code:
Private Sub mnuPrint_Click()
With dlgCommonDialog
.DialogTitle = "Print"
.CancelError = True
.Flags = cdlPDReturnDC + cdlPDNoPageNums
.ShowPrinter
End With
End Sub
to bring up the Print dialog. My question is, can you then do custom printing with the Printer object after bringing up the Print dialog? I currently have a function that I call to do my printing. (It's a pretty raw solution I know but it works in a couple printers I've tried. I'm not opposed to suggestions to improve it though :D )
VB Code:
Private Function PrintPicture()
Form1.Picture7.Print Form1.Label7.Caption
Form1.Picture5.Print Form1.Label1.Caption
Step = 200
For i = 5 To 45
If Check1(i).Value = 1 Then
Form1.Picture2.Line (0, Step)-(500, Step), Check1(i).ForeColor
Form1.Picture2.Print Check1(i).Caption
Step = Step + 500
End If
Next
Form1.Picture2.Line (0, 0)-(2415, 0)
Form1.Picture2.Line (0, 0)-(0, Step)
Form1.Picture2.Line (0, Step)-(2415, Step)
Form1.Picture2.Line (2415, 0)-(2415, Step)
'Picture2.Visible = True
Printer.PaintPicture Picture1.Image, 1000, 3500
Printer.PaintPicture Form1.Picture7.Image, ((Printer.Width - Form1.Label7.Width) / 2), ((3500 - Form1.Label7.Height) / 2)
Printer.PaintPicture Form1.Picture2.Image, 1000 + Picture1.Width + 50, 3500 + (Picture1.Height - (Step + 80))
Printer.PaintPicture Form1.Picture3.Image, (Printer.Width - (Form1.Picture3.Width + 600)), Printer.Height - (Form1.Picture3.Height * 2)
Printer.PaintPicture Form1.Picture4.Image, 100, Printer.Height - (Form1.Picture3.Height * 2)
Printer.PaintPicture Form1.Picture5.Image, 1000 + Picture1.Width + 50 + ((2415 / 2) - (Form1.Label1.Width / 2)), 3500 + Picture1.Height - Step - 50 - Form1.Picture5.Height
Printer.CurrentX = 750
Printer.CurrentY = 3400
For i = 0 To 6
Printer.Print Label8(i).Caption
Printer.CurrentX = 700
Printer.CurrentY = Printer.CurrentY + 985
Next
Printer.CurrentX = 900
Printer.CurrentY = 10800
For i = 13 To 19
If i < 19 Then
Printer.Print Label8(i).Caption;
Printer.CurrentX = Printer.CurrentX + 1150 - (Label8(i + 1).Width / 2)
Printer.CurrentY = 10800
Else: Printer.CurrentX = 900 + Picture1.Width - (Label8(19).Width / 3)
Printer.Print Label8(19).Caption
End If
Next
Printer.EndDoc
'Picture2.Visible = False
End Function
So I guess my question is, can I call that function from inside the Print dialog?
Maybe this will help you...
...instead of using the Common Dialog, try using the actual Printer Settings Dialog. I don't know if this helps at all, but maybe.
http://support.microsoft.com/default...b;en-us;322710