Vb to read macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I am creating a database analyzer that creates specific documentation on
the contents of a database for a report I created. I have all the required
information for tables/queries/reports/forms/modules but now i need to
extract all pertinent information from macros. Can this be done? i have
tried docmd.openmacro but with no success. I need to get all the 'lines' of
the macros to know which quries or actions they perform.

thanks for any and all help!
Ben
 
Ben,

Macros do not store the processes they perform. You can set flags
(variables) which you can read later to determing what actions have been
performed.

One other option would be to store data in a table designed to hold the
desired information.

In either case you will have to develope your own code to determine the
status.

I'm not sure that this is what you are looking for, but if you need
additional info, please post here.
 
Ben said:
Hello,
I am creating a database analyzer that creates specific
documentation on the contents of a database for a report I created.
I have all the required information for
tables/queries/reports/forms/modules but now i need to extract all
pertinent information from macros. Can this be done? i have tried
docmd.openmacro but with no success. I need to get all the 'lines'
of the macros to know which quries or actions they perform.

I can't remember if there's a more direct way, but you can use the
undocumented SaveAsText method to save the macro to a text file, then
read that text file to get the information. Here's a model statement:

Application.SaveAsText _
acMacro, "MacroName", "C:\Your Path\MacroName.txt"
 
Thank you dirk for your reply. Thats what I was looking for except i was
hoping i didnt have to create a file.

As a followup, how could i delete the file that the code creates?

Thanks,
Ben
 
Ben said:
Thank you dirk for your reply. Thats what I was looking for except i
was hoping i didnt have to create a file.

As a followup, how could i delete the file that the code creates?

The VB "Kill" statement deletes a file.

Kill "C:\Your Path\MacroName.txt"
 
Back
Top