请问VB操作word问题 我有一个word,里面有一些合并单元格,那么就有一些单元格是不存在的,请问如何判断哪些单元格是不存在的单元格? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://download.csdn.net/detail/veron_04/1627134 '生成表格 Set usTable = ActiveDocument.Tables.Add(Range:=Word.Selection.Range, NumRows:=4, NumColumns:=9) With usTable .Range.ParagraphFormat.KeepWithNext = True '保持与下段同页,即表格中不分页 .Borders(wdBorderLeft).LineStyle = wdLineStyleSingle .Borders(wdBorderLeft).LineWidth = wdLineWidth050pt .Borders(wdBorderRight).LineStyle = wdLineStyleSingle .Borders(wdBorderRight).LineWidth = wdLineWidth050pt .Borders(wdBorderTop).LineStyle = wdLineStyleSingle .Borders(wdBorderTop).LineWidth = wdLineWidth050pt .Borders(wdBorderBottom).LineStyle = wdLineStyleSingle .Borders(wdBorderBottom).LineWidth = wdLineWidth050pt .Borders(wdBorderHorizontal).LineStyle = wdLineStyleSingle .Borders(wdBorderHorizontal).LineWidth = wdLineWidth050pt .Borders(wdBorderVertical).LineStyle = wdLineStyleSingle .Borders(wdBorderVertical).LineWidth = wdLineWidth050pt .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone .Borders.Shadow = False .Rows.Alignment = wdAlignRowCenter .Range.ParagraphFormat.Alignment = wdAlignParagraphCenter '水平居中 .Range.Cells.VerticalAlignment = wdCellAlignVerticalCenter '垂直居中 End With '开始填写数据 For usI = 1 To 4 For usJ = 1 To 9 usTable.Cell(usI, usJ).Range.Text = usBZData(usI, usJ) '在当前单元格中填写内容' usTable.Cell(usI, usJ).Select '选择单元格' Word.Selection.TypeText Text:=usBZData(usI, usJ) '在当前单元格中填写内容 Next usJ Next usI 插入一个4行5列的表格,将第2列的第2、3行合并。'选择表格ActiveDocument.Tables(1).Select'显示表格的列数:为5MsgBox Selection.Columns.Count'显示表格的行数:为4MsgBox Selection.Rows.Count'选择第2列Selection.Tables(1).Columns(2).Select'显示表格的行数:为3MsgBox Selection.Rows.Count'说明有单元格被合并了'可以填充这3个单元格的数据ActiveDocument.Tables(1).Columns(2).Selectfor i=1 to 3 Selection.Cells(i).Range.Text = inext 不太合理的程序用错误处理取cell属性,正常取到的就是存在的,取不到的就是被合并的 webbrowser 所打开页面的图标 DataReport打印数据向上移 一个简单的文件读取问题! 关于DAO的一些基本操作问题! 如何改变鼠标的指针!!!!!!!????? 关于app.path的用法 http://haiyanggov.vicp.net/12.gif这个报表怎么实现阿 如何提取系统图标(立马结账)!!!!!! 我有两个问题想请教下大家?请帮下解决小弟我的问题,好吗?结果正确,马上给分! 能帮我测试一下软件吗? vb 在打开多个窗口时,如果窗口已经打开过需显示到最上层(急求解,请帮忙!) vb6中怎么显示这种格式
Set usTable = ActiveDocument.Tables.Add(Range:=Word.Selection.Range, NumRows:=4, NumColumns:=9)
With usTable
.Range.ParagraphFormat.KeepWithNext = True '保持与下段同页,即表格中不分页
.Borders(wdBorderLeft).LineStyle = wdLineStyleSingle
.Borders(wdBorderLeft).LineWidth = wdLineWidth050pt
.Borders(wdBorderRight).LineStyle = wdLineStyleSingle
.Borders(wdBorderRight).LineWidth = wdLineWidth050pt
.Borders(wdBorderTop).LineStyle = wdLineStyleSingle
.Borders(wdBorderTop).LineWidth = wdLineWidth050pt
.Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
.Borders(wdBorderBottom).LineWidth = wdLineWidth050pt
.Borders(wdBorderHorizontal).LineStyle = wdLineStyleSingle
.Borders(wdBorderHorizontal).LineWidth = wdLineWidth050pt
.Borders(wdBorderVertical).LineStyle = wdLineStyleSingle
.Borders(wdBorderVertical).LineWidth = wdLineWidth050pt
.Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone
.Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone
.Borders.Shadow = False
.Rows.Alignment = wdAlignRowCenter
.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter '水平居中
.Range.Cells.VerticalAlignment = wdCellAlignVerticalCenter '垂直居中
End With
'开始填写数据
For usI = 1 To 4
For usJ = 1 To 9
usTable.Cell(usI, usJ).Range.Text = usBZData(usI, usJ) '在当前单元格中填写内容
' usTable.Cell(usI, usJ).Select '选择单元格
' Word.Selection.TypeText Text:=usBZData(usI, usJ) '在当前单元格中填写内容
Next usJ
Next usI
'选择表格
ActiveDocument.Tables(1).Select
'显示表格的列数:为5
MsgBox Selection.Columns.Count
'显示表格的行数:为4
MsgBox Selection.Rows.Count
'选择第2列
Selection.Tables(1).Columns(2).Select
'显示表格的行数:为3
MsgBox Selection.Rows.Count
'说明有单元格被合并了'可以填充这3个单元格的数据
ActiveDocument.Tables(1).Columns(2).Select
for i=1 to 3 Selection.Cells(i).Range.Text = i
next
用错误处理
取cell属性,正常取到的就是存在的,取不到的就是被合并的