怎样将vb中的数据存入word表格
答案:1 悬赏:70
解决时间 2021-02-15 17:49
- 提问者网友:白柏唇蜜
- 2021-02-15 04:39
怎样将vb中的数据存入word表格
最佳答案
- 二级知识专家网友:兮沫♡晨曦
- 2021-02-15 04:54
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 引用~
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯