System.Runtime.InteropServices.COMException(0x800A1492)

时间:2019-02-11 07:57:38

标签: vb.net ms-word

我在vb.net项目中遇到异常:

System.Runtime.InteropServices.COMException(0x800A1492):您不能将此选择粘贴到表中。在Microsoft.Office.Interop.Word.Range.Paste()

代码是:

bookmark.Select()
_WordApplication.ActiveDocument.SetCompatibilityMode(Microsoft.Office.Interop.Word.WdCompatibilityMode.wdWord2013)
_WordApplication.Selection.Copy()
_WordApplication.Selection.MoveStart()
_WordApplication.Selection.MoveUp(Unit:=Word.WdUnits.wdLine, Count:=1)
_WordApplication.Selection.Range.Paste()
_WordApplication.Selection.Paste()

此代码在某些WIN7 / WIN10环境中有效,但在部分环境中无效。 Word版本是2013。 知道有什么问题吗?

0 个答案:

没有答案