Xtreme Visual Basic Talk

Xtreme Visual Basic Talk (http://www.xtremevbtalk.com/)
-   .NET Office Automation (http://www.xtremevbtalk.com/-net-office-automation/)
-   -   Exception - If you are attempting to access members on a late-bound object variable (http://www.xtremevbtalk.com/-net-office-automation/327680-exception-attempting-access-late-bound-object-variable.html)

dd8 07-01-2015 09:32 PM

Exception - If you are attempting to access members on a late-bound object variable
 
vb.net VS2013

In my vb.net solution Im using late binding to obtain information values from a document, and the error displays

The Exception error displays 'Public member 'Description' on type 'NdDocumentsInfo' not found

Details:
System.MissingMembermp was caught
HResult=-2146233070
Message=Public member 'Description' on type 'NdDocumentInfo' not found.
Source=Microsoft.VisualBasic
StackTrace:
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
at Corrs.Business.Word.WordDocument.GetDMRef(WordDocument worddoc, Int32 type) in C:\WIP\Corrs Office 2013\Trunk\Source\Source\Corrs.Office.Integration\Corrs.Business\Word

\WordDocument.vb:line 2121
InnerException:



in vba, the code works successfully and returns the values

Dim ndo As Object
ndo = CreateObject("ndOffice.EchoingDataService")
Dim docInfo As Object
docInfo = ndo.getDocumentInfo(worddoc.Document.Application.ActiveDocument.FullNa me)

When I step and hover my mouse over docInfo
It displays docInfo{<COM type>}
Error No Children available



Public Function GetDMRef(ByVal worddoc As WordDocument, ByVal type As Integer) As String

If worddoc.Document.Application.Visible = False Then Return Nothing

Try

Dim omyob As New DMS.DM5Library(worddoc)
Dim ndo As Object
ndo = CreateObject("ndOffice.EchoingDataService")
Dim docInfo As Object
docInfo = ndo.getDocumentInfo(worddoc.Document.Application.ActiveDocument.FullNa me)


If Not docInfo Is Nothing Then

If type = 1 Then Return docInfo.client & "-" & docInfo.Matter
If type = 2 Then Return docInfo.Description

If type = 3 Then Return docInfo.Author
If type = 4 Then Return docInfo.Client
If type = 5 Then Return docInfo.Matter

If type = 7 Then Return docInfo.Matter
If type = 8 Then Return docInfo.Client

Else

Return String.Empty
End If


Catch argEx As ArgumentException
Logger.Message(argEx)
Return String.Empty
Catch ex As Exception
Corrs.Common.Logger.Log(Me.GetType(), ex)
Return String.Empty
End Try
Return String.Empty
End Function


All times are GMT -6. The time now is 03:44 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO v2.0.15 (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
All site content is protected by the Digital Millenium Act of 1998. Copyright©2001-2011 MAS Media Inc. and Extreme Visual Basic Forum. All rights reserved.
You may not copy or reproduce any portion of this site without written consent.