Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To save a lot of time, is there any reason why you don’t use the built in documenter?</p> <p>Tools->analyze->documenter</p> <p>The above has the ability to produce a report that has all code in forms, reports, modules and class modules. This report can be send to word or even saved as a text file.</p> <p>I only mentioning this to save you time and effort. There not a need to write any code here.</p> <p>more notes: I don’t think you can do this external. You can use ms-access as com object, and use code to pull out the code as text, but you need access installed on that computer.</p> <p>There is two approaches, one is to use the saveastext command. This will export any form, report, code etc as a text file (this what the source code add-ins all use).</p> <p>The 2nd approach is to write automation code. Here is code in native access (VBA), but you just as well write this code in any language that supports com objects. The code will look like:</p> <pre><code> Dim db As Database Dim Doc As Document Dim mdl As Module Dim lngCount As Long Dim strForm As String Dim strOneLine As String Dim sPtr As Integer Set db = CurrentDb() ' count module LOC For Each Doc In db.Containers("Modules").Documents DoCmd.OpenModule Doc.Name Set mdl = Modules(Doc.Name) lngCount = lngCount + mdl.CountOfLines For i = 1 To lngCount strOneLine = mdl.Lines(i, 1) Debug.Print strOneLine Next i Set mdl = Nothing DoCmd.Close acModule, Doc.Name Next Doc </code></pre> <p>The above code can be easliy modifed to seach, or export the text. I think using saveastext is less code however, but then you get the forms definition etc, and that likely not what you want.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload