-
Hi
I want to know if there is a way to get:
- All the names of functions in an Active Vb Project in
the VBinstance.
- The Current selected code!
I also got another problem with addins but this is in another thread. So if you are good in Addins you can visit it, too.
It is called Resize on Addin.
Thanks!
-
Yes there is. The following code gets names of all functions/procedures in active code pane for the VBInstance
Dim oCodeModule As CodeModule
Dim iCounter As Integer
If VBInstance.ActiveCodePane Is Nothing Then
MsgBox "Please Open the Code Window ...then try again"
Exit Sub
Else
Set oCodeModule = VBInstance.ActiveCodePane.CodeModule
For iCounter = 1 To oCodeModule.Members.Count
If oCodeModule.Members(iCounter).Type =
vbext_mt_Method Then
Debug.Print oCodeModule.Members(iCounter).Name
End If
Next iCounter
End If
Hope u can work out how to use it for the active project!
-
Hey Thanks!
I'm sure I can add in easily into my addin (it isn't very big)!!
I played around with those Methods, but not with the Members property.
So Is there anybody who can solve the second problem? I guess it is easy to, but I wasn't able to do so.
I want to get the currently selected text!
Thanks