首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VBA >

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

2012-02-19 
请问word中如何读取表格中的内容?请问word中如何读取表格中的内容?[解决办法]Dim XlAppAs New Word.Applic

请问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 "

热点排行