This project has moved. For the latest updates, please go here.

Target on invocation

Nov 15, 2013 at 2:06 PM
Some times when i try to get entity (eg Selection.ShapeRange), i have exception target of invocation. How can i check for entity is available for get?
Coordinator
Nov 22, 2013 at 12:00 AM
please explaine what means "sometimes". at the moment, its impossible for me to pin point the problem. it looks like you have no selection sometimes. in this case the com server(office) returns an error(HResult) and the .net runtime system throws the corresonding exception.
Feb 25, 2014 at 11:31 AM
Hi!

Same exception at mail send:

Exception

Message: Exception has been thrown by the target of an invocation.


Date: 25.02.2014 09:09:44
Type: COMException
Source: NetOffice
Additional: * COM Error Code: -2147467259
  • COM Message: Exception has been thrown by the target of an invocation.
Custom Information:
Stack Trace: at NetOffice.Invoker.PropertyGet(COMObject comObject, String name, Object[] paramsArray)
at NetOffice.OutlookApi._MailItem.get_To()
at MyCompany.MyNameSpace.DocManager.MailItem_Send(Boolean& Cancel)

.Net Framework Version 4.0

Microsoft Word

Build Full: 14.0.7113
Description: Microsoft Word 2010

Referenced Assemblies

ExcelApi: 1.6.0.0
NetOffice: 1.6.0.0
OutlookApi: 1.6.0.0
TWordApi: 1.6.0.0

Thanks for help!