MS Access是否有“任务列表”?

时间:2012-06-19 15:04:30

标签: ms-access

MS Access中是否有等效的Visual Studio任务列表?

我很乐意把TODO放在我的代码中,看看我打开的内容一目了然。

1 个答案:

答案 0 :(得分:3)

玩得开心:)

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