参考:http://www.foxtable.com/webhelp/topics/1145.htm
设置窗口,添加一个按钮,按钮代码大概
With Tables("数据打印表")
For i As Integer = .TopPosition To .BottomPosition
.Position = i
For j As Integer = 1 To .Rows(i)("打印份数")
Dim Book As New XLS.Book(ProjectPath & "Attachments\格式1.xls") '打开模板
Dim fl As String = ProjectPath & "Reports\格式1_" & .Rows(i)("物料编码") & j & ".xls"
Book.Build() '生成细节区
Book.Save( fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Verb = "Print" '指定动作
Proc.Start()
Dim r As Row = Tables("打印记录表").AddNew
r("已打印物料编码") = .Rows(i)("物料编码")
Next
Next
End With