save or export Macro as text

  • Thread starter Thread starter vbasean
  • Start date Start date
V

vbasean

I thought I saw on a forum or site that you could save a Macro as text. I'm
not looking to convert the Macro to vba. I just want to list all the macro
actions and properties.

I have a db that uses Macros (don't ask me why they use Macros, it's just
what they built) and I want to iterate these Macros to extract all the
queries and items that are dependant so I can clean the db up.

I don't want to use the documentor because it's too sloppy and hard to read.
I'd just like to iterate the items in the Macro and debug.print or drop it
into a Word doc.

Thanks in advance
 
Dim dbsCurr As DAO.Database
Dim cntCurr As DAO.Container
Dim docCurr As DAO.Document

Set dbsCurr = CurrentDb()

Set cntCurr = dbsCurr.Containers("Scripts")
For Each docCurr In cntCurr.Documents
Application.SaveAsText acMacro, docCurr.Name, _
"D:\Document\" & docCurr.Name & ".txt"
Next docCurr
 
I found it

<code>Sub z()
Dim dbs As CurrentProject
Dim obj As Object

Set dbs = Application.CurrentProject
For Each obj In dbs.AllMacros
SaveAsText acMacro, obj. Name, "C:\temp\" & obj.Name & ".txt"
Next obj

End Sub </code>
 
Douglas,

Thanks a million. I had seen an article online and I looked and looked and
then... I found it. lol. I wanted to update the thread just in case someone
came looking for the answer.

It just happed at the very same time you answered my question. :D

Thank you for helping me.
 
Back
Top