Private Function GetSubMain() As String
Dim v As VBComponent
Dim l As Long, s As String
For Each v In VBInstance.ActiveVBProject.VBComponents
With v
If .Type = vbext_ct_StdModule Then
l = v.CodeModule.CountOfLines
If l > 0 Then
s = v.CodeModule.Lines(1, l)
If InStr(1, s, "sub main()", vbTextCompare) > 0 Then
GetSubMain = v.Name
Exit Function
End If
End If
End If
End With
Next
End Function
Tuesday, June 12, 2012
Di manakakah letak procedure Sub Main? - VB6 Add-Ins
Labels:
Add-Ins-VB6