View Single Post
 
Old 07-01-2015, 10:32 PM
dd8 dd8 is offline
Newcomer
 
Join Date: Jul 2015
Posts: 3
Default 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
Reply With Quote