【发布时间】:2015-06-17 07:53:28
【问题描述】:
我想使用 Microsoft.Interop.Word 以编程方式打开一个 word 文档,并将注释插入到表格单元格中。 我有单元格范围的开始和结束位置。 (Range.Start \ Range.End)
Application.ActiveDocument.Select(); // select ative document
Range rg = Application.Selection.Range; // get the range of the current selection (all document)
if (rg.Tables.Count > 0)
{
Microsoft.Office.Interop.Word.Range rngTab = rg;
//set the coordinate of the Range of the text
rngTab.Start = startRng;
rngTab.End = endRng;
doc.ActiveWindow.Visible = true;
rg.Select();
Application.ActiveDocument.Comments.Add(rngTab, ref commentText);
}
插入评论时Word崩溃
【问题讨论】:
-
Word 崩溃?没有错误信息? Word 是否安装正确?哪个版本的Word?请添加您的问题的答案!
-
Microsoft Word 2013,Word 安装正确,没有错误信息,也不例外,只是崩溃“Microsoft Word 已停止工作”然后重新启动 microsoft word。如果我在平面文本中插入评论,效果很好
-
互操作版本 14.0.0.0
标签: c# .net ms-word interopservices