Print Code

  • Thread starter Thread starter mission2java_78
  • Start date Start date
M

mission2java_78

Guest
Is there a way to move all source code (behind forms / reports / modules / etc) to a word document rather than sitting there and copying and pasting into word? I want to print out all my source code and after printing and using 900 pages (while having disgruntled fellow employees) at work I realized that if I punched holes through my code it would punch the code right out if I wanted to put it in a binder.

Jon
 
Seems to be only for modules...Im talking reports / forms / modules / everything that has a lick of VB in it.

It doesnt look like its possible unless Pat Hartman has some module whipped up :-).

Jon
 
You can apply the code you've learned from the link I mentioned above to the write the code behind forms or reports to the text file as well.

Access names the the form module with the Form_ prefix to the form name, i.e. if your form is frmForm1, its module is named Form_frmForm1. This system is applied to the report modules as well with the Report_ prefix.

Then check the form below out.

Sub GetFormModuleText(frm As String)
Dim mdl As Module, intI As Integer, strForm As String
DoCmd.OpenForm frm, , , , , acHidden
strForm = "Form_" & frm
DoCmd.OpenModule strForm
Set mdl = Modules(strForm)
Debug.Print mdl.Lines(mdl.CountOfDeclarationLines + 1, mdl.CountOfLines)
DoCmd.Close acModule, strForm, acSaveNo
DoCmd.Close acModule, frm, acSaveNo
End Sub

Now what you have to do is to loop thru all forms and reports and feed their names to the code above. I presume you know how to loop for the forms and reports.
 

Users who are viewing this thread

Back
Top Bottom