export all modules to txt files

G

Guest

Hi,

I need to export all the code from an Acces database to txt files. I know
how to do it manually, but I need to automate the process. I don't know
Access object model very well and all I could come up with was to use
CurrenProject.AllModules and OutputTo, but I need to export Form and Report
modules as well.

What is the preferred way of doing this?

This is the part of my code that exports all modules:

set access = CreateObject ("Access.Application")
access.Visible = true
access.OpenCurrentDataBase "C:\CBRDB3\***.mdb", false, "******"

set cp = access.CurrentProject

For Each m In cp.AllModules
access.DoCmd.OutputTo acOutputModule, m.Name , acFormatTXT, "C:\test\" &
m.Name & ".txt", false
Next
 
6

'69 Camaro

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