回复 5楼nicholas的帖子
测试需要通过 Viewer 调用打印方法,我理解你的问题是分别调用同一台电脑上的两个打印机打印同一文档。
那么只需要分别制定打印机名称,调用打印方法即可,我使用两个虚拟打印机可以成功打印:
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- Dim sr1 As New SectionReport1
- sr1.Run()
- Me.Viewer1.Document = sr1.Document
- End Sub
- Private Sub PrintToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PrintToolStripMenuItem.Click
- Me.Viewer1.Document.Printer.PrinterName = "Send To OneNote 2013"
- Me.Viewer1.Print(False)
- Me.Viewer1.Document.Printer.PrinterName = "Microsoft XPS Document Writer"
- Me.Viewer1.Print(False)
- End Sub
复制代码
或者我没有理解你的意思,可以进一步解释下。 |