Private Sub Command3_Click()
Dim wrdApp As Word.Application
Set wrdApp = New Word.Application
m1 = "EMPRESA" & vbTab & vbTab & ":" & vbTab & "MADECOR LTDA." & vbCrLf & vbCrLf
mg = "TABLA DE LISTADOS" & vbCrLf & "Tabla nº 1. Niveles / Estado Mercaderia" & vbCrLf & vbCrLf
With msflex
For D = 1 To .Rows - 1
'.Col = 0 .Row = d
dm = .TextMatrix(D, 0)
'.Col = 1 .Row = d
em = .TextMatrix(D, 1)
aesc = dm & vbTab & vbTab & em
If .Row = 1 Then
pesc = aesc
End If
If .Row > 1 Then
pesc = pesc & vbCrLf & aesc
End If
men = "Nivel" & vbTab & vbTab & "Estado" & vbCrLf & pesc & vbCrLf & vbCrLf
Next D
End With
With msflex1
For c = 1 To .Rows - 1
'For t = 0 To .Cols - 1
'.Col = 0 .Row = c
dm1 = .TextMatrix(c, 0)
'.Col = 1 .Row = c
em1 = .TextMatrix(c, 1)
aesc1 = dm1 & vbTab & vbTab & em1
If .Row = 1 Then
pesc1 = aesc1
End If
If .Row > 1 Then
pesc1 = pesc1 & vbCrLf & aesc1
End If
men1 = "Nivel" & vbTab & vbTab & "Estado" & vbCrLf & pesc1
'Next t
Next c
End With
mg1 = "TABLA DE LISTADOS ANEXOS" & vbCrLf & vbCrLf & "Tabla nº 2. Niveles / Estado Mercaderia" & vbCrLf & vbCrLf
With wrdApp
.Visible = True
.Documents.Add
.ActiveDocument.Content.Font.Size = 12
.ActiveDocument.Content.Font.Name = "Verdana"
'.ActiveDocument.Content.Font.Bold = True
.ActiveDocument.Content.Text = m1 & mg & men & mg1 & men1 '"Resulto"
If optVista.Value = True Then
.ActiveDocument.PrintPreview
End If
End With
End Sub