Office 2003 vb.net Addin Procofline returns wrong ProcType

K

Kriegler Johann

Can anybody solve following Problem?
Code:
For Each objVBProject As microsoft.Vbe.Interop.VBProject In
VBEInterop.VBProjects
For Each objComponent As microsoft.Vbe.Interop.VBComponent In
objVBProject.VBComponents

With objcomponent.CodeModule
Dim lngStartZeile As Integer = .CountOfDeclarationLines + 1
Do Until lngStartZeile >= .CountOfLines
Dim lngProcTyp As microsoft.Vbe.Interop.vbext_ProcKind Dim
strProcName As String= .ProcOfLine(lngStartZeile, lngproctyp)

<- Here is the Problem. Normally lngProctyp returns the "vbext_ProcKind"
but vb.net returns every time 0 (vbext_pk_Proc)->
The same Code in VBA does function correctly.

Dim lngBodyLine As Integer = .ProcBodyLine(strProcName, lngproctyp)
Dim lngProcCountLines As Integer = .ProcCountLines(strProcName, lngProcTyp)
lngStartZeile = lngStartZeile + lngProcCountLines
Loop
End With
Next
Next
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top