Assuming Access 2000 or later (CurrentProject, CurrentData and AccessObject
were new in that version) ...
Public Sub PrintObjNames(ByVal strFileName As String, Optional boolOverWrite
As Boolean, _
Optional ByVal boolSysTables As Boolean)
Dim intFile As Integer
Dim aob As AccessObject
intFile = FreeFile
If boolOverWrite Then
Open strFileName For Output As intFile
Else
Open strFileName For Append As intFile
End If
Print #intFile, "Data Access Pages"
For Each aob In CurrentProject.AllDataAccessPages
Print #intFile, aob.Name
Next aob
Print #intFile, ""
Print #intFile, "Forms"
For Each aob In CurrentProject.AllForms
Print #intFile, aob.Name
Next aob
Print #intFile, ""
Print #intFile, "Macros"
For Each aob In CurrentProject.AllMacros
Print #intFile, aob.Name
Next aob
Print #intFile, ""
Print #intFile, "Modules"
For Each aob In CurrentProject.AllModules
Print #intFile, aob.Name
Next aob
Print #intFile, ""
Print #intFile, "Reports"
For Each aob In CurrentProject.AllReports
Print #intFile, aob.Name
Next aob
'Note - queries and tables collections are members of CurrentData,
'not CurrentProject. CurrentData also contains other collections
'(AllViews, AllStoredProcedures) which are relevent to ADPs.
Print #intFile, ""
Print #intFile, "Queries"
For Each aob In CurrentData.AllQueries
Print #intFile, aob.Name
Next aob
Print #intFile, ""
Print #intFile, "Tables"
For Each aob In CurrentData.AllTables
If UCase(Mid$(aob.Name, 2, 3)) <> "SYS" Or boolSysTables Then
Print #intFile, aob.Name
End If
Next aob
Close #intFile
End Sub