Вот код, невидимость ворда ставлю при Class_Initialize()
Public Function printRecord(sINF As ClientData, room As String, Period As String, NumRec As Integer) As Byte
Dim TableWord As Word.Table
Dim lastTab As Integer, lastRow As Integer
On Error GoTo errLab:
DocWord.Select
With DocWord.Application.Selection
lastTab = .Tables.Count
Set TableWord = DocWord.Tables.Item(lastTab)
If TableWord.Columns.Count < 12 Then
DocWord.Close
printRecord = 1
Exit Function
End If
TableWord.Rows.Add
lastRow = TableWord.Rows.Count
TableWord.Rows(lastRow).Range.Font.Bold = False
TableWord.Cell(lastRow, 1).Range.Text = NumRec
TableWord.Cell(lastRow, 2).Range.Text = room
TableWord.Cell(lastRow, 3).Range.Text = Period
TableWord.Cell(lastRow, 4).Range.Text = sINF.F & " " & sINF.I & " " & sINF.O
TableWord.Cell(lastRow, 5).Range.Text = sINF.wasBorn
TableWord.Cell(lastRow, 6).Range.Text = sINF.LivePlace
TableWord.Cell(lastRow, 7).Range.Text = sINF.Document
TableWord.Cell(lastRow,
.Range.Text = sINF.DocumentNumber
TableWord.Cell(lastRow, 9).Range.Text = sINF.DocumentGiven
TableWord.Cell(lastRow, 10).Range.Text = sINF.BorderCrossPlace & " " & sINF.DateCrossBorder
TableWord.Cell(lastRow, 11).Range.Text = sINF.LivePlace
TableWord.Cell(lastRow, 12).Range.Text = sINF.Nacional
.EndOf
End With
printRecord = 0
Exit Function
errLab:
MsgBox "Unexpected Error in obj WordExport Metod printRecord" & vbNewLine & Err.number & vbNewLine & Err.Description, vbCritical, softName
printRecord = 1
End Function