Dim tv As WinForm.TreeView = e.Form.Controls("TreeView1") Dim dlg As New FolderBrowserDialog If dlg.ShowDialog = DialogResult.Ok Then ' MessageBox.Show("你选择的目录是:" & dlg.SelectedPath,"提示") For Each nd As WinForm.TreeNode In tv.AllNodes If nd.Level = 1 AndAlso nd.Checked Then e.Form.Text = "导出【" & nd.Name & "】表中,请稍后..." Dim ex As New Exporter ex.SourceTableName = nd.Name '指定导出表 ex.FilePath = dlg.SelectedPath & "\" & nd.Name & ".xls" '指定目标文件 ex.Format = "Excel" '导出格式为Excel ex.Export() '开始导出 End If Next End If e.Form.Text = e.Form.Name MessageBox.Show("导出结束")
|