才疏学浅,如何批量删除word报表中的空行?恳请大师赐教。 Dim tm As String
With Tables("发文登记")
If .TopPosition > -1 Then '如果选定区域包括数据行
For i As Integer = .TopPosition To .BottomPosition
Dim p As Row = .Rows(i)
If p("县以下")=False And p("聘用人数")=1 Then
tm = ProjectPath & "Attachments\lg1.doc" '指定模板文件
End If
If p("县以下")=False And p("聘用人数")>1 Then
tm = ProjectPath & "Attachments\lg100.doc" '指定模板文件
End If
Dim d As Date = p("发文日期")
Dim fl As String = ProjectPath & "Reports\ligao\"& format(d,"yyyy") & "-" & p("文号") & p("主送单位") & "--拟稿" & ".doc" '指定目标文件
Dim wrt As New WordReport(Tables("发文登记"),tm,fl) '定义一个WordReport
wrt.BuildOne(p)
wrt.quit()
Next
End If
End With
[此贴子已经被作者于2023/8/14 20:56:11编辑过]