Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.
Coding ToDo List
From Wiki
A question was recently asked regarding a coding ToDo list similar to the one available in Visual Studio. Such a list is not available for MS Access and VBA, but it occurred to me that Search All Databases in Folder for Words in Code Modules could easily be adapted to provide a list of certain comments.
This code will list all comments included in the afind array.
- Sub ToDoList()
- Dim afind As Variant
- Dim sfound as String
- Dim mdl As Object
- Dim modtext As String, modarray As Variant
- Dim leline As Long
- Dim i, j, k
- afind = Split("HACK,TODO", ",")
- For i = 1 To VBE.ActiveVBProject.VBComponents.Count
- Set mdl = VBE.ActiveVBProject.VBComponents(i).CodeModule
- leline = mdl.CountOfLines
- If leline > 0 Then
- modtext = mdl.Lines(1, leline)
- For j = 0 To UBound(afind)
- If InStr(modtext, afind(j)) > 0 Then
- sfound = sfound & vbCrLf & "****" & afind(j) _
- & " found in " & mdl.Name
- modarray = Split(modtext, vbCrLf)
- For k = 0 To UBound(modarray)
- If InStr(modarray(k), afind(j)) > 0 Then
- sfound = sfound & vbCrLf & k
- sfound = sfound & " " & modarray(k)
- End If
- Next
- End If
- Next
- End If
- Next
- MsgBox sfound
- End Sub



LTD Social Sitings
Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.