急C#项目编程
来源:百度知道 编辑:UC知道 时间:2024/09/21 15:46:13
将数据以自制表格的形式插入到word中时报错Microsoft.Office.Interop.Word.Tables并不包含“Item”的定义
程序: Microsoft.Office.Interop.Word.Range rng2 = wordDoc.Range(ref location, ref location);
wordDoc.Tables.Add(rng2, 14, 6, ref missingValue, ref missingValue);
wordDoc.Tables.Item(1).Rows.HeightRule = Microsoft.Office.Interop.Word.WdRowHeightRule.wdRowHeightAtLeast;
程序: Microsoft.Office.Interop.Word.Range rng2 = wordDoc.Range(ref location, ref location);
wordDoc.Tables.Add(rng2, 14, 6, ref missingValue, ref missingValue);
wordDoc.Tables.Item(1).Rows.HeightRule = Microsoft.Office.Interop.Word.WdRowHeightRule.wdRowHeightAtLeast;
你在对象浏览器中查一下嘛
上面都写的是this[int]了
所以wordDoc.Tables[1].Rows.HeightRule = Microsoft.Office.Interop.Word.WdRowHeightRule.wdRowHeightAtLeast;
语法错误
你把源程序发一下吧,应该是字符串的问题吧
很复杂