Results 1 to 3 of 3

Thread: Hey Addin People

  1. #1

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181

    Question

    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!
    Sanity is a full time job

    Puh das war harter Stoff!

  2. #2
    Junior Member
    Join Date
    Sep 2000
    Posts
    17

    Thumbs up

    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!


  3. #3

    Thread Starter
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    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

    Sanity is a full time job

    Puh das war harter Stoff!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width