Solved

List Macro Contents

Posted on 2009-05-05
14
476 Views
Last Modified: 2013-11-29
Hello EE,

I need a query to list macro contents (query names, conditions, etc.) for a macro or for all macros.  Is this possible using the Access system tables?  If so, which?

Thank you
0
Comment
Question by:Lawrence Barnes
  • 5
  • 3
  • 3
  • +1
14 Comments
 
LVL 75
ID: 24306552
Tools>>Analyze>>Documenter .... select Macros

mx
0
 
LVL 75
ID: 24306566
You can't get this directly from the system tables, other than a list of macros.  The Documenter will give you what you want.

mx
0
 
LVL 5

Author Comment

by:Lawrence Barnes
ID: 24309511
Hi MX,

I've seen your posts before and respect your opinion.  But :)  I've got a LOT of macros with many rows in each.  The output from the documenter is hard to work with.  If the system tables does not support it, is there a way to read these lines and output to a text file via VBA or other means?  (insert pleading look here :)

LVBarnes
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 75
ID: 24309591
I suppose it might be possible using VBA and looping through the Macro collection and if ... all of those properties are exposed ... pulling them out.  I don't have time at the moment to look into that.  I admit that the Documeter is not the optimum tool for this purpose.

mx
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24311120
lvbarnes,

You need to be specific when you say:
   "macro contents (query names, conditions, etc.) for a macro or for all macros."

This is what the documenter does.
So again, can you "specifically" state what you mean when you say that the documenter's output is:
  "hard to work with"
What does this mean, "Specifically".

In other words, can you post a clear example of what you "DO" want the output to be?

Thanks

JeffCoachman
0
 
LVL 5

Author Comment

by:Lawrence Barnes
ID: 24314159
Hello Jeff,

Specifically :)  I need all of the elements for each row of a macro placed into a table or a text file so that I can place this information into another data source.

While the documenter does display this information in its own format, it is not easy to transfer this information from the Documenter output to another data source.  It would be much easier if the name and parameters of each element were in a table structure or in a delimited text file.

LVBarnes
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24315578
LVBarnes,

Thanks for the clarification.

I do not know of a way to do what you are asking.

I do know that there are other Products that will document Access databases.
MX would propably know better

The one I am familiar with is FMSinc's Total Access Analyzer.
*However*, the documentation utility only comes as one part of a larger set of tools.
And it is priced a little on the high side.

You should invesitgate one of these utilities.

I believe the Macro "Steps" are incoded into the Access files, there are (AFAIK) not accessible through any system tables.

JeffCoachman
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24363765
you can export a macro as a text file using VBA. The format is
(AutoExec macro)
Version =196611
ColumnsShown =2
Begin
    Condition ="Date()>#6/30/2008#"
    Action ="RunMacro"
    Argument ="Macro2"
End

is this an acceptable format?
0
 
LVL 5

Author Comment

by:Lawrence Barnes
ID: 24365268
Hello Capricorn,
I apologize for being a noob... Is the above to setup a function or sub?  I tried running from the immediate window but was missing some pieces.  Where should I place this.

Thanks,
LVBarnes
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24365359
that is an AutoExec macro converted to text file, and i was asking if the format is acceptable ?
0
 
LVL 5

Author Comment

by:Lawrence Barnes
ID: 24366224
TY for the clarification.  Yes, I can work with this format.  However for macros with multiple lines, changing to the format below would be easier (but not necessary.)
(AutoExec macro)
Version =196611
ColumnsShown =2
Begin
    Condition ="Date()>#6/30/2008#", Action ="RunMacro", Argument ="Macro2"
    Condition ="", Action ="OpenQuery", Argument ="qryQuery1"
    Condition ="", Action ="OpenForm", Argument1 ="frmForm1", Argument2 ="Form", Argument3 ="FilterName"
End
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 24366374
place this codes in a regular module
create a folder in c:\MyMacro


sub exportMacros()
dim expPath as string,d As Document,C As Container,db As Database

expPath="c:\MyMacro\"      

set db=currentdb
    Set C = db.Containers("Scripts")
    For Each d In C.Documents
        Application.SaveAsText acMacro, d.Name, expPath & "Macro_" & d.Name & ".txt"
    Next d

end sub

that will save all your macros as text file in folder  "C:MyMacros"
0
 
LVL 5

Author Closing Comment

by:Lawrence Barnes
ID: 31578097
Thank you!
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 24370454
Good tip cap
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question