1

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

我希望能够将 TODO 放入我的代码中,然后一目了然地查看我打开的内容。

4

1 回答 1

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
于 2012-06-19T15:43:31.267 回答