ok, here what happen. When I tried it after making all of your additions. It worked - sort of. It put the code in full and accurately - outside the "End Sub". Here is the final code I made into a library.
Function AddCodeToReports97(ByVal strCode As String, _
ByVal skipSubs As Boolean, _
ParamArray reportNames() As Variant) As Boolean
On Error GoTo ErrHandler
Dim db As DAO.Database
Dim accObj As DAO.Document
Dim rpt As Report
Dim mdl As Module
Dim intTtl As Integer
Dim intCtr As Integer
Dim blnMatch As Boolean
Dim lngProcLine As Long
Const VB_PROC = 0 ' value of extensiblity constant vbext_pk_Proc
' If code is empty - abort.
If Len(strCode) = 0 Then GoTo ExitHere
intTtl = UBound(reportNames)
Set db = Workspaces(0).Databases(0)
For Each accObj In db.Containers![Reports].Documents
' Init flag.
blnMatch = False
' Check for match.
If (intTtl = -1) Then ' process all if missing param.
blnMatch = True
ElseIf accObj.Name = reportNames(intCtr) Then 'check reports by name.
' handle subreport skipping (must have "sub" in report name).
If Not skipSubs Then
blnMatch = True
Else
If InStr(UCase(accObj.Name), "SUB"

= 0 Then
blnMatch = True
End If
End If
End If
If blnMatch Then
' turn off screen updating.
DoCmd.Echo False
' Open in design view - not available in runtime version.
DoCmd.OpenReport accObj.Name, acViewDesign
' assign object reference.
Set rpt = Reports(accObj.Name)
' check module status.
If rpt.HasModule = False Then
rpt.HasModule = True
End If
' assign module reference.
Set mdl = rpt.Module
' Find report's Open() event.
On Error Resume Next
lngProcLine = mdl.ProcBodyLine("Report_Open", VB_PROC)
' If not found - add it.
If Err <> 0 Then
Err.Clear
On Error GoTo ErrHandler
mdl.InsertText "Public Sub Report_Open(Cancel As Integer)"
mdl.InsertText "'@ Auto-coded " & Date & vbCrLf & strCode
mdl.InsertText "End Sub"
Else
' found it, just insert code.
On Error GoTo ErrHandler
mdl.InsertLines lngProcLine + 1, _
"'@ Auto-coded " & Date & vbCrLf & strCode
End If
' close and save.
DoCmd.Close acReport, rpt.Name, acSaveYes
End If
Next accObj
AddCodeToReports97 = True
ExitHere:
' make sure screen updating is back on
DoCmd.Echo True
Exit Function
ErrHandler:
MsgBox "Error: " & Err & " - " & Err.Description
Resume ExitHere
End Function