Extracting info from macros via VBA.

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
 
S

Stuart

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

But if anyone can help... :)

Stuart
 
T

TC

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top