Extracting info from macros via VBA.

  • Thread starter Thread starter Stuart
  • Start date Start date
S

Stuart

Hi all,

Can anybody recommend a nice way to get to the contents of
a macro via VBA? I need to find where functions or objects
are being used by macro commands (e.g. RunCode). I've
considered using "DoMenuItem" & "Convert Macros To Visual
Basic" (from the "Tools" menu) but that seems a really
ugly workaround.

Many thanks,

Stuart
 
Sorry realised that isn't the group I should have posted
this too!

But if anyone can help... :)

Stuart
 
You can get the names of all the macros from the Scripts container, but you
can not get their content from there. Maybe use this method to drive some
other process (such as "convert macros to VBA")?

(untested)

dim db as database, doc as document
set db = currentdb()
for each doc in db.containers![scripts].documents
debug.print "next macro name is: ", doc.name
'>>do something with that macro, here <<
next
set db = nothing

HTH,
TC
 
Back
Top