#1
|
|||
|
|||
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() 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? |
#2
|
||||
|
||||
The Windows environment is unimportant; what matters is the Word version. If a given PC lacks Word 2013 (cf. your reference to wdWord2013), your code will fail. As it is, your code is especially inefficient, per its repeated use of Selections.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
comexception, range.paste, wordapplication |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Getting COMException Incompatible file type and file extension | sbalerao | Mail Merge | 0 | 04-21-2011 10:30 AM |