Sub test1() 'MsgBox ActiveDocument.Words(2) 'MsgBox ActiveDocument.Characters.Count 'ActiveDocument.Words(1).Bold = True ActiveDocument.Range.InsertAfter _ vbCrLf & "Jaagup" End Sub Sub test2() 'ActiveDocument.SaveAs "c:\temp\test.doc" For i = 1 To ActiveDocument.Paragraphs.Count MsgBox ActiveDocument.Paragraphs(i).Style Next i End Sub Sub test3() Open "c:\temp\test1.txt" For Output As #1 Print #1, "tere" Close #1 End Sub Sub test4() avatud = False For i = 1 To ActiveDocument.Paragraphs.Count If avatud And ActiveDocument.Paragraphs(i). _ Style = "Heading 1" Then Close #1 Exit For End If If ActiveDocument.Paragraphs(i).Style = "Heading 1" Then Open "c:\temp\peatykk1.txt" For Output As #1 avatud = True End If If avatud Then Print #1, ActiveDocument.Paragraphs(i).Range.Text End If Next i End Sub Sub test5() loendur = 0 For i = 1 To ActiveDocument.Paragraphs.Count If (loendur > 0) And ActiveDocument.Paragraphs(i). _ Style = "Heading 1" Then Close #1 End If If ActiveDocument.Paragraphs(i).Style = "Heading 1" Then loendur = loendur + 1 Open "c:\temp\peatykk" & loendur & ".txt" For Output As #1 End If If loendur > 0 Then Print #1, ActiveDocument.Paragraphs(i).Range.Text End If Next i Close #1 End Sub Sub test6() Dim dokument As Document Dim alg As Document Set alg = ActiveDocument loendur = 0 For i = 1 To alg.Paragraphs.Count If (loendur > 0) And alg.Paragraphs(i). _ Style = "Heading 1" Then dokument.SaveAs "c:\temp\peatykk" & loendur & ".doc" End If If alg.Paragraphs(i).Style = "Heading 1" Then loendur = loendur + 1 Set dokument = Documents.Add End If If loendur > 0 Then dokument.Range.InsertAfter alg.Paragraphs(i).Range.Text End If Next i dokument.SaveAs "c:\temp\peatykk" & loendur & ".doc" End Sub