|
下述附件里的分类打印模块里在print那里加多了一个打印预览的参数preview:=True,代码就无法正常运行,请教以下如何解决,因为如果没有打印预览,有时会忘记设置打印双面翻短边,导致打印有问题,而且因自动打印的页码较多,要取消打印需按多次取消才可以(打印多少页就要按取消多少次)
Private Sub cmd_Printout_Click()
Dim print_cat As String
With Me
print_cat = .cb_list
If Len(print_cat) Then
If clsSQL Is Nothing Then Set clsSQL = New ClassSQL
sSQL = "SELECT [序号] FROM [数据源$] WHERE [性质]='" & print_cat & "'"
vData = clsSQL.GetDataBySQL(SQL:=sSQL, SqlType:="Excel", FileOrServer:=ThisWorkbook.FullName, OutputTitle:=False)
If IsArray(vData) Then
For i = 1 To UBound(vData)
Sheet1.Range("V4") = vData(i, 1)
Sheet1.Calculate
Sheet1.PrintOut Copies:=1, Collate:=True, preview:=True
Next
End If
End If
End With
End Sub
|
|