Printing All VBA Code

J

Jim Shaw

I'm having too many Access crashes to trust my code to
Access backups anymore. I want a copy of ALL the code in
my project in an *.txt file. Is there an easy way do
acomplish that? I know I cannot directly restore by db
from that, but I'll at least have a source for cut & paste
recovery of sections of code.

Thanks
 
J

Jim Allensworth

I'm having too many Access crashes to trust my code to
Access backups anymore. I want a copy of ALL the code in
my project in an *.txt file. Is there an easy way do
acomplish that? I know I cannot directly restore by db
from that, but I'll at least have a source for cut & paste
recovery of sections of code.

Thanks

Hmm, I hope the code in question is not the cause of the crashes.
However, you might take a look at the undocumented
Application.SaveAsText method. To save all of the forms with any code
behind just loop throught your forms and something like

Application.SaveAsText acForm,"frmMyForm" ,"C:\BUFolder\MyForm.txt"

Use this approach with modules as well.

And, you can restore directly from the text file ...

Application.LoadFromText acForm, "frmMyForm","C:\BUFolder\MyForm.txt"

If you want to take a look at these with intellisense, open the Object
Browser, right click on it and choose Show Hidden Members. You will
now be able to access the arguments with intellisense - try it in
debug window. (note: this will expire with the current instance)

- Jim
 
F

fredg

Jim said:
I'm having too many Access crashes to trust my code to
Access backups anymore. I want a copy of ALL the code in
my project in an *.txt file. Is there an easy way do
acomplish that? I know I cannot directly restore by db
from that, but I'll at least have a source for cut & paste
recovery of sections of code.

Thanks

Jim,
See Microsoft KnowledgeBase article:

209869
"ACC2000: How to Export All Modules in a Database to Text Files"
 
J

Jim Shaw

Thanks to Jim & Fredg
That's a big help!
-Jim
-----Original Message-----


Jim,
See Microsoft KnowledgeBase article:

209869
"ACC2000: How to Export All Modules in a Database to Text Files"


--
Fred
Please reply only to this newsgroup.
I do not respond to personal e-mail.
.
 

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