Dim ex As Exporter
For Each nd As WinForm.TreeNode In tv.AllNodes
If nd.Checked = True Then ''''最末级节点,且已被勾选
ex = New Exporter
ex.SourceTableName = nd.Text '指定导出表
Select Case e.Form.Controls("cb_Format").value
Case "txt"
ex.Format = "Delimited" '导出格式为固定宽度的文本文件
ex.Header = True
ex.NewTableName = nd.Text '指定文件名,注意无须扩展名
ex.FilePath = fl & "\" '指定目标文件
Case "Access"
ex.Format = "Access2007" '导出格式为Access 2007
ex.FilePath = fl & "\" & nd.Text & ".accdb" '指定目标文件
Case "Excel"
ex.FilePath = fl & "\" & nd.Text & ".xlsx" '指定目标文件
ex.Format = "Excel2007" '导出格式为Excel
End Select
ex.Export() '开始导出
End If
Next