Sub paragrComp
   Dim tm, newDoc as Object
	Set tm = CreateObject("TextMaker.Application")
	tm.Application.Visible = False 
	Dim i,dc, nPar(1 To 2), iPar, vPar as Integer
	Dim erg as Integer
	Dim rA, rB, sA, sB as Long
	Dim txt(1 to 2) as String
	tm.Application.Visible = True
	tm.Application.Activate
	txt(1) = tm.Documents(1).Name
	txt(2) = tm.Documents(2).Name
	Set newDoc = tm.Documents.Add
	newDoc.Activate
	With newDoc.Selection
		.Font.Size = 16
		.Font.Bold = True
		.Typetext "Dateivergleich vom "
		.TypeText date
		.Font.Bold = False	
		.TypeParagraph
		.Font.Size = 10
		.TypeText "Doc 1 = "
		.TypeText txt(1)
		.TypeText ", Doc 2 = "
		.TypeText txt(2)
		.TypeParagraph
		.TypeParagraph
	End With


	For dc = 1 to 2
		tm.Documents(dc).Activate
		nPar(dc) = tm.ActiveDocument.Paragraphs.Count
	Next dc
	vPar = nPar(2)
	If nPar(1) < vPar Then
		vPar = nPar(1)
	End If
	For iPar = 1 to vPar
		For dc = 1 To 2
			tm.Documents(dc).Activate
			With tm.ActiveDocument
				.Selection.SetRange .Paragraphs(iPar).Range.Start, .Paragraphs(iPar).Range.End
			End With
			txt(dc) = tm.ActiveDocument.Selection.Text
		Next
		rA = Len(txt(1))
		rB = Len(txt(2))
		erg = StrComp(txt(1),txt(2))
'		newDoc.Activate
		if ra = rb Then
			If erg <> 0 Then
				newDoc.Selection.Font.Bold = True
				newDoc.Selection.TypeText "Absatz: "
				newDoc.Selection.TypeText iPar
				newDoc.Selection.Font.Bold = False
				newDoc.Selection.TypeParagraph
				newDoc.Selection.TypeText "Doc 1: "
				newDoc.Selection.TypeText txt(1)
				newDoc.Selection.TypeParagraph
				newDoc.Selection.TypeText "Doc 2: "
				newDoc.Selection.TypeText txt(2)
				newDoc.Selection.TypeParagraph
			End If
		Else 
			newDoc.Selection.Font.Bold = True
			newDoc.Selection.TypeText "Absatz: "
			newDoc.Selection.TypeText iPar
			newDoc.Selection.Font.Bold = False
			newDoc.Selection.TypeParagraph
			newDoc.Selection.TypeText "Doc 1: "
			newDoc.Selection.TypeText txt(1)
			newDoc.Selection.TypeParagraph
			newDoc.Selection.TypeText "Doc 2: "
			newDoc.Selection.TypeText txt(2)
			newDoc.Selection.TypeParagraph
		End If

	Next iPar
tm.Application.Visible = True 
newDoc.Activate
Set tm = Nothing
end sub