Printing All VBA Code

  • Thread starter Thread starter Jim Shaw
  • Start date Start date
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
 
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
 
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"
 
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.
.
 
Back
Top