By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,676 Members | 1,636 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,676 IT Pros & Developers. It's quick & easy.

Code changes from this code to print queries necessary to print out macro definitions

P: n/a
In searching the web for a method to print out macro definitions, I
found this code from Allen Browne to print out query definitions. Is
there a similar way to print out macros?

Public Function ShowAllQueries()
Dim db As DAO.Database
Dim qdf As DAO.QueryDef

Set db = CurrentDb()
For Each qdf In db.QueryDefs
Debug.Print qdf.Name, qdf.SQL
Next
End Function

In other words, does DAO or some other object expose something like a
MacroDef, similar to a QueryDef?

Thank you.
Sep 2 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Newbie" <Ne****@gmail.comwrote in message
<av********************************@4ax.com>:
In searching the web for a method to print out macro definitions, I
found this code from Allen Browne to print out query definitions. Is
there a similar way to print out macros?

Public Function ShowAllQueries()
Dim db As DAO.Database
Dim qdf As DAO.QueryDef

Set db = CurrentDb()
For Each qdf In db.QueryDefs
Debug.Print qdf.Name, qdf.SQL
Next
End Function

In other words, does DAO or some other object expose something like a
MacroDef, similar to a QueryDef?

Thank you.
I don't think Macros are exposed the same way. You can dump their
contents to a text file, and take it from there. Air code.

dim ao as accessobject
for each ao in currentproject.allmacros
application.saveastext acmacro, ao.name, "c:\" & ao.name & ".txt"
next ao

--
Roy-Vidar
Sep 2 '06 #2

P: n/a
On Sat, 02 Sep 2006 19:50:17 +0200, RoyVidar
<ro*************@yahoo.nowrote:
>"Newbie" <Ne****@gmail.comwrote in message
<av********************************@4ax.com>:
>In searching the web for a method to print out macro definitions, I
found this code from Allen Browne to print out query definitions. Is
there a similar way to print out macros?
<snip>
>In other words, does DAO or some other object expose something like a
MacroDef, similar to a QueryDef?

Thank you.

I don't think Macros are exposed the same way. You can dump their
contents to a text file, and take it from there. Air code.

dim ao as accessobject
for each ao in currentproject.allmacros
application.saveastext acmacro, ao.name, "c:\" & ao.name & ".txt"
next ao
Thank you. I will give it a try.
Sep 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.