Q:

Get BaseName Of Element DTE _applicationObject Visual Studio Add-In

I'm trying to get definition of element with visual studio add-in but I can't reach
the signature of the element on selected line.
I have a code blocks like:
sub Test(){
  Dim TestVariable As New TestClass
  TestVariable.Execute()
}

I select the line that is
TestVariable.Execute()

But this operation, which is in add-in:
_applicationObject.ActiveDocument.ProjectItem.FileCodeModel. _
CodeElementFromPoint(sel.AnchorPoint, vsCMElement.vsCMElementFunction)

returns me Test(), which is topmost element, but i need the innermost.
I tried to change 'vsCMElementFunction' property to attribute etc.
but they all returned Nothing.
Does anyone know another way to do this?

A:

I found a solution for my problem, and I wanted to share it.
'When Your Cursor On The Element, Call Your Add-In
'In Exec() Function You Can Follow These Steps:

'Open Object Browser And Copy The Signature

_applicationObject.ExecuteCommand("Edit.GoToDefinition")
_applicationObject.ExecuteCommand("Edit.Copy")

'To Close The Object Browser

Dim win As EnvDTE.Window
win = DirectCast(_applicationObject.ActiveWindow, EnvDTE.Window)

'And ta ta, Full Signature Of The Element

basename = My.Computer.Clipboard.GetText()

'And Here We Get The Base Name

Dim tobjbasearr As String() = basename.Split(CChar("."))
Dim tobjbase As String = tobjbasearr(0)

