You will need some understanding of VBA code to implement this.
A rudimentary example follows:
Function DumpQueries() As String
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Const strcFile = "C:\MyQueries.txt"
Open strcFile For Output As #1
Set db = CurrentDb
For Each qdf In db.QueryDefs
If Not qdf.Name Like "~*" Then
Print #1, qdf.Name & ": " & Trim$(Replace(qdf.SQL, vbCrLf, " "))
End If
Next
Close #1
Set qdf = Nothing
Set db = Nothing
DumpQueries = strcFile
End Function