Gorilla Code: Determining Module Type

  • Thread starter Thread starter Jim Shaw
  • Start date Start date
J

Jim Shaw

BlankContext: Access 2002 VBA

I'm working on a VBA Code Beautifier program.

I would like to determine, for each of my VBA modules, its Type, be it a
normal module (.bas) or a user defined class (.cls). These file name
extensions are what you get when the module is exported to a file via
SendKey statements. I need to know the extension so I can access the file
from VBA later on in my program.

I am able to get a list of my VBA Module names by iterating through the list
of modules with: modname$(I) = db.Containers("Modules").Documents(I).Name.
I then use modname$(I) in the exported file name.

How can I get the filename extension or the module type in this context?

Thanks
Jim
 
You'll have to open the module and check its Type property. The Documents
collection simply doesn't store information like that.
 
Jim said:
BlankContext: Access 2002 VBA

I'm working on a VBA Code Beautifier program.

I would like to determine, for each of my VBA modules, its Type, be it a
normal module (.bas) or a user defined class (.cls). These file name
extensions are what you get when the module is exported to a file via
SendKey statements. I need to know the extension so I can access the file
from VBA later on in my program.

I am able to get a list of my VBA Module names by iterating through the list
of modules with: modname$(I) = db.Containers("Modules").Documents(I).Name.
I then use modname$(I) in the exported file name.

How can I get the filename extension or the module type in this context?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acchap7.asp

has some sample code you might use....
 

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

Back
Top