以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  连续打印  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=50117)

--  作者:发财
--  发布时间:2014/4/29 16:24:00
--  连续打印
    Dim Book As New XLS.Book(ProjectPath & "Attachments\\作废收购单.xls")
    Dim fl As String = ProjectPath & "Reports\\作废收购单.xls"
    Book.Build()
    Book.Save(fl)
    Dim App As New MSExcel.Application
    Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(fl)
    Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
    Ws.PrintOut
    App.Quit
上述代码如何做到指定几次连续打印?
--  作者:Bin
--  发布时间:2014/4/29 16:25:00
--  
打印10次
Dim Book As New XLS.Book(ProjectPath & "Attachments\\作废收购单.xls")
    Dim fl As String = ProjectPath & "Reports\\作废收购单.xls"
    Book.Build()
    Book.Save(fl)
    Dim App As New MSExcel.Application
    Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(fl)
    Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
for i as integer = 1 to 10
    Ws.PrintOut
next
   App.Quit

--  作者:有点甜
--  发布时间:2014/4/29 16:27:00
--  

 看这里,可以设置printout的打印参数的。

 

http://msdn.microsoft.com/zh-cn/library/microsoft.office.tools.excel.worksheet.printout.aspx