Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2005

Tip: Looking for answers? Try searching our database.

Vb to read macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ben - 28 Dec 2005 14:05 GMT
Hello,
 I am creating a database analyzer that creates specific documentation on
the contents of a database for a report I created.  I have all the required
information for tables/queries/reports/forms/modules but now i need to
extract all pertinent information from macros.  Can this be done? i have
tried docmd.openmacro but with no success.  I need to get all the 'lines' of
the macros to know which quries or actions they perform.

thanks for any and all help!
Ben
Mr B - 28 Dec 2005 15:01 GMT
Ben,

Macros do not store the processes they perform.  You can set flags
(variables) which you can read later to determing what actions have been
performed.

One other option would be to store data in a table designed to hold the
desired information.

In either case you will have to develope your own code to determine the
status.

I'm not sure that this is what you are looking for, but if you need
additional info, please post here.
Signature

HTH

Mr B

> Hello,
>   I am creating a database analyzer that creates specific documentation on
[quoted text clipped - 6 lines]
> thanks for any and all help!
> Ben
Dirk Goldgar - 28 Dec 2005 15:34 GMT
> Hello,
>   I am creating a database analyzer that creates specific
[quoted text clipped - 4 lines]
> docmd.openmacro but with no success.  I need to get all the 'lines'
> of the macros to know which quries or actions they perform.

I can't remember if there's a more direct way, but you can use the
undocumented SaveAsText method to save the macro to a text file, then
read that text file to get the information.  Here's a model statement:

   Application.SaveAsText _
       acMacro, "MacroName", "C:\Your Path\MacroName.txt"

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Ben - 28 Dec 2005 16:37 GMT
Thank you dirk for your reply.  Thats what I was looking for except i was
hoping i didnt have to create a file.  

As a followup, how could i delete the file that the code creates?

Thanks,
Ben

> > Hello,
> >   I am creating a database analyzer that creates specific
[quoted text clipped - 11 lines]
>     Application.SaveAsText _
>         acMacro, "MacroName", "C:\Your Path\MacroName.txt"
Dirk Goldgar - 28 Dec 2005 16:46 GMT
> Thank you dirk for your reply.  Thats what I was looking for except i
> was hoping i didnt have to create a file.
>
> As a followup, how could i delete the file that the code creates?

The VB "Kill" statement deletes a file.

   Kill "C:\Your Path\MacroName.txt"

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.