Dim wa As New Word.Application Dim wd As Word.Document Dim filename As String = filename = C:\Documents and Settings\gy\桌面\1.doc wd = wa.Documents.Open(filename) For i As Integer = 0 To wd.Tables.Item(1).Rows.Count - 1 For j As Integer = 0 To wd.Tables.Item(1).Columns.Count - 1 If Me.DataGridView1.Rows(i).Cells(j).Value Is Nothing Then wd.Tables.Item(1).Cell(i 1, j 1).Range.Text = Else wd.Tables.Item(1).Cell(i 1, j 1).Range.Text = Me.DataGridView1.Rows(i).Cells(j).Value.ToString.Trim End If Next Next 添加microsoft word 10.0 object library 引用~