Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Kristopher Davis   on Oct 21 In MS Office Category.

  
Question Answered By: Kim Cruz   on Oct 21

Not exactly what you want I think.... but anyway...


Function fncGetCurrentProcName() As String
' Return the Procedure name  under the cursor.

Dim lnglSLine As Long
Dim lnglELine As Long
Dim lnglSCol As Long
Dim lnglECol As Long
Dim objlCodePane As VBIDE.CodePane
Dim objlCodeModule As VBIDE.CodeModule
Dim strlProc As String

Set objlCodePane = VBE.ActiveCodePane
Set objlCodeModule = objlCodePane.CodeModule

objlCodePane.GetSelection lnglSLine, lnglSCol, lnglELine, lnglECol
strlProc = objlCodeModule.ProcOfLine(lnglSLine, vbext_pk_Proc)

Set objlCodePane = Nothing
Set objlCodeModule = Nothing

fncGetCurrentProcName = strlProc
' ***********************************************************************
End Function

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on VBComponets & VBIDE Extensibilty Object Model ? Or get search suggestion and latest updates.


Tagged: