版主新年好!
1、VBA原代码:
Sub 删除看不见空格()
ActiveDocument.Content.Find.Execute FindText:=Chr(10), replacewith:="", Replace:=wdReplaceAll
End Sub
2、我改了一下,想加入下面的代码时,提示要声明wdReplaceAll,不知道怎么办了,请指教!
doc.Content.Find.Execute(FindText:=Chr(10), replacewith:="", Replace:=wdReplaceAll)
3、加在下面的横线处:
'''
'word报表:带表格
Dim clbx1 As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox1")
Dim clbx2 As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox2")
For Each j As String In clbx2.CheckedIndices
Dim tm As String = ProjectPath & "模板文件\" & clbx2.Items(j) '指定模板文件
For Each i As Integer In clbx1.CheckedIndices
Dim fl As String = ProjectPath & "成品文件\" & clbx1.items(i) & clbx2.Items(j) '指定目标文件
Dim nm As String = CurrentTable.Name
Dim dr As DataRow =DataTables(nm).Find("名称 = '" & clbx1.items(i) & "'")
If dr IsNot Nothing
Dim wrt As New WordReport(Tables(nm),tm,fl) '定义一个WordReport
wrt.BuildOne(dr)
wrt.quit
Dim app As New MSWord.Application
try
Dim doc = app.Documents.Open(fl)
doc.Content.Find.Execute(FindText:="^l", replacewith:="^p", Replace:=2)
doc.Content.Find.Execute(FindText:="^13", replacewith:="^p", Replace:=2)
......(原帖在http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=95616)