?
Solved

List Macro Contents

Posted on 2009-05-05
14
Medium Priority
?
481 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 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

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.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

771 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