VB中怎样打印文件
在VB中怎么打印文件,文件打印对话框调用出来了。
谢谢!
问题点数:40、回复次数:3Top
1 楼renjunjun(飞黄)回复于 2002-08-13 19:06:32 得分 20
用 NewPage 和 EndDoc 方法打印 Printer 对象的内容。
打印对象的分辩率为300DPI
Printer.PrintQuality = 300
打印的文档居页面中间
Printer.ScaleLeft = -((Printer.Width - PFrm.Width) / 2)
Printer.ScaleTop = -((Printer.Height - PFrm.Height) / 2)
打印对象的缩放
Printer.Zoom = 50
打印对象中文字的定位
Printer.CurrentX = 0
Printer.CurrentY = 0
用EndDoc方法就会把文档送到假脱机打印机中
Printer.Print "This is page 1."
Printer.NewPage
Printer.Print "This is page 2."
Printer.EndDoc
取消打印作业
可用 KillDoc 方法结束当前的打印作业。例如,可用对话框询问是继续打印还是结束文档:
Sub PrintOrNot()
Printer.Print "This is the first line to illustrate KillDoc method"
Printer.Print "This is the second line to illustrate KillDoc method"
Printer.Print "This is the third line to illustrate KillDoc method"
If vbNo = MsgBox("Print this fine document?", vbYesNo) Then
Printer.KillDoc
Else
Printer.EndDoc
End If
End Sub
兄弟,我说这么多,你可得多给我点儿分啊!!祝好运!!!Top
2 楼shizhonghao(szh)回复于 2002-08-14 00:50:19 得分 10
用OrchidPrinter
http://www.csdn.net/cnshare/soft/12/12442.shtm
Top
3 楼goujianling(等你解答)回复于 2002-08-14 02:02:41 得分 10
打印的文档居页面中间
Printer.ScaleLeft = ((Printer.Width - PFrm.Width) / 2)
Printer.ScaleTop = ((Printer.Height - PFrm.Height) / 2)
还可以用打应的文件的PRINT属性呀
Printer.Print "This is page 1."
Printer.NewPage
Printer.Print "This is page 2."
Printer.EndDoc
Top




