Solved

List Macro Contents

Posted on 2009-05-05
14
473 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
 
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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 119

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
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 119

Accepted Solution

by:
Rey Obrero 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now