Private Sub Command1_Click() On Error Resume Next Dim wApp As New Application Dim wDoc As Document Dim wNewTable As Table Set wDoc = wApp.Documents.Add Selection.Range Set wNewTable = wDoc.Tables.Add(wDoc.Range, MSHFlexGrid1.Rows, MSHFlexGrid1.Co ls
下面通过图文并茂的方式给大家介绍asp.net中批量导出access某表内容到word文档的方法,具体详情如下:
一、需求:
需要将表中每一条记录中的某些内容导出在一个word文档中,并将这些文档保存在指定文件夹目录下
二、界面,简单设计如下:
三、添加office相关引用
添加后可在解决方案资源管理器中看到:
四、添加form1中的引用
using System.Data.OleDb;
using System.Data.SqlClient;
using System.IO;
usi