Superpat
Member
- Local time
- Today, 18:28
- Joined
- Aug 15, 2020
- Messages
- 96
Hello,
I have this code who is good, but I don't know how to modify to go directy to my form (strNomModule) and modify this "For Each oComponent In Application.VBE.ActiveVBProject.VBComponents"
Thank to help
I have this code who is good, but I don't know how to modify to go directy to my form (strNomModule) and modify this "For Each oComponent In Application.VBE.ActiveVBProject.VBComponents"
Code:
Function RechercheIntituleModForm(ByVal sSearchTerm As String, strNomModule As String)
Dim oComponent As Object 'VBComponent
For Each oComponent In Application.VBE.ActiveVBProject.VBComponents
Debug.Print "Module IntituleModForm : " & oComponent.CodeModule
If oComponent.CodeModule = strNomModule Then
If oComponent.CodeModule.Find(sSearchTerm, 1, 1, -1, -1, False, False, False) = True Then
Debug.Print "Module contient et vrai : " & oComponent.Name 'Name of the current module in which the term was found (at least once)
RechercheIntituleModForm = True
Else
Debug.Print "Module ne contient pas : " & oComponent.Name 'Name of the current module in which the term was not found (at least once)
RechercheIntituleModForm = False
End If
Exit For 'We know it exist so let leave, no point continuing
End If
Next oComponent
End Function