老师,窗口打印下部有一个表,有可能超过一页A4纸怎么添加页眉页脚;打印按钮的代码如下:e.Form.Controls("Label2").text = Date.Today
For Each c As Col In Tables(e.Form.Name & "_table1").cols
If Tables(e.Form.Name & "_table1").FindRow(c.name & " is not null") < 0 Then
c.visible = False
End If
Next
Tables(e.Form.Name & "_table1").AutoSizeRows
e.Form.Controls("Table1").MaxRows = e.Form.Controls("最大行数").value
Dim doc As PrintDoc = e.Form.gernateprintdoc() '定义一个报表
'doc.PageSetting.Landscape = True '横向打印
doc.Preview() '预览