Reading Microsoft Access Macros via VBA code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul M

    Reading Microsoft Access Macros via VBA code

    Hello,
    is there any way of reading Microsoft Access Macros via VBA code? Or
    better still through VB .net code?

    By reading I mean being able to read what the actions are plus any
    parameters & comments.

    I dont want to execute any of the steps just read them.

    Dont want to convert them to VBA functions either, I would like to read
    them direct.

    Hope someone can help...

    Thanks
    Paul M
  • Allen Browne

    #2
    Re: Reading Microsoft Access Macros via VBA code

    Hi Paul

    I don't think VBA allows you to do this directly, but there is an indirect
    method.

    You can loop through CurrentProject. AllMacros to get the name of each macro,
    and export the contents to a text file with:
    SaveAsText acMacro, "Macro1", "C:\Macro1. txt"

    That allows you to Open and read through the text file. It's messy, but
    feasible, and certainly works if you are trying to find if a particular
    action is present.

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Paul M" <paul@nospam.co .uk> wrote in message
    news:du3gbl$imm $1@newsg4.svr.p ol.co.uk...[color=blue]
    > Hello,
    > is there any way of reading Microsoft Access Macros via VBA code? Or
    > better still through VB .net code?
    >
    > By reading I mean being able to read what the actions are plus any
    > parameters & comments.
    >
    > I dont want to execute any of the steps just read them.
    >
    > Dont want to convert them to VBA functions either, I would like to read
    > them direct.
    >
    > Hope someone can help...
    >
    > Thanks
    > Paul M[/color]


    Comment

    • Jeremy Wallace

      #3
      Re: Reading Microsoft Access Macros via VBA code

      There's also a way to convert macros to code. I don't know that this
      would be a profitable path to follow, but you might look into how to do
      that programmaticall y, and then do your searching right in the module
      created.

      Jeremy
      --
      Jeremy Wallace
      Fund for the City of New York


      Comment

      Working...