当前位置: 代码迷 >> VBA >> 请教word中怎么读取表格中的内容
  详细解决方案

请教word中怎么读取表格中的内容

热度:9853   发布时间:2013-02-26 00:00:00.0
请问word中如何读取表格中的内容?
请问word中如何读取表格中的内容?

------解决方案--------------------------------------------------------
Dim XlApp As New Word.Application
Dim Doc As New Document
Dim Rag As Range
Dim Tb As Table
Dim C0 As Cell, C1 As Cell, C2 As Cell, C3 As Cell, C4 As Cell, C5 As Cell, C6 As Cell


Set C1 = Rag.Tables(1).Cell(1, 1): C1.Range.Text = "1,1 "
Set C2 = Rag.Tables(1).Cell(1, 2): C2.Range.Text = "1,2 "
Set C3 = Rag.Tables(1).Cell(1, 3): C3.Range.Text = "1,3 "

Set C4 = Rag.Tables(1).Cell(2, 1): C4.Range.Text = "2,1 "
Set C5 = Rag.Tables(1).Cell(2, 2): C5.Range.Text = "2,2 "
Set C6 = Rag.Tables(1).Cell(2, 3): C6.Range.Text = "2,3 "
  相关解决方案