Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old September 2nd, 2006, 05:25 PM
Newbie
Guest
 
Posts: n/a
Default Code changes from this code to print queries necessary to print out macro definitions

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.

  #2  
Old September 2nd, 2006, 05:45 PM
RoyVidar
Guest
 
Posts: n/a
Default 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


  #3  
Old September 2nd, 2006, 05:55 PM
Newbie
Guest
 
Posts: n/a
Default 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.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.