|
- Sub a0929_TextSplit()
- Dim r As Range
- MkDir "d:\zzz"
- ActiveDocument.Content.InsertParagraphAfter
- ActiveDocument.Content.Find.Execute "([0-9]{1,})[.、]", , , 1, , , , , , "\1.", 2
- With Selection
- .HomeKey 6
- Do
- Do
- .MoveEnd 4
- Loop Until .Next(4, 1) Like "#.*" Or .Next(4, 1) Like "##.*" Or .Next(4, 1) Like "###.*" Or .Next(4, 1) Like "####.*" Or .Next(4, 1).End = ActiveDocument.Content.End
- Set r = .Range
- Documents.Add.Content.Text = r.Text
- ActiveDocument.SaveAs FileName:="d:\zzz" & Replace(ActiveDocument.Paragraphs(1).Range, vbCr, "") & ".docx"
- ActiveDocument.Close
- r.Delete
- Loop Until ActiveDocument.Paragraphs.Count = 1
- End With
- ActiveDocument.Close 0
- MsgBox "Complete!", 0 + 48
- End Sub
复制代码 |
|