Connecting Tech Pros Worldwide Forums | Help | Site Map

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

Newbie
Guest
 
Posts: n/a
#1: Sep 2 '06
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.

RoyVidar
Guest
 
Posts: n/a
#2: Sep 2 '06

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


"Newbie" <Newbie@gmail.comwrote in message
<avfjf2162rcbgg6vbkmikqr736aragur7a@4ax.com>:
Quote:
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


Newbie
Guest
 
Posts: n/a
#3: Sep 2 '06

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


On Sat, 02 Sep 2006 19:50:17 +0200, RoyVidar
<roy_vidarNOSPAM@yahoo.nowrote:
Quote:
>"Newbie" <Newbie@gmail.comwrote in message
><avfjf2162rcbgg6vbkmikqr736aragur7a@4ax.com>:
Quote:
>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>
Quote:
Quote:
>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.
Closed Thread