Thread: [Solved] COMException 0x800A1492
View Single Post
 
Old 02-18-2019, 10:42 PM
petrimo petrimo is offline Windows 10 Office 2013
Novice
 
Join Date: Feb 2019
Posts: 1
petrimo is on a distinguished road
Default COMException 0x800A1492

I'm getting an exception in my vb.net project:
System.Runtime.InteropServices.COMException (0x800A1492): You cannot paste this selection into a table. at Microsoft.Office.Interop.Word.Range.Paste()

The code is:
Code:
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()
Bookmark is a table in word-template. The idea is to read values from SQL-database and insert several rows to table in word-document. I have tried with different versions of Microsoft.Office.Interop.Word.dll with no success.
This code works in older WIN7-environments but not in all WIN10-environments. In some WIN10-environment it works OK.
Any idea what could be wrong?
Reply With Quote