|
- Sub 固定文本提取()
- Dim i As Paragraph, j As String, doc As Document
- j = ActiveDocument.Name
- Set doc = Documents.Add
- Documents(j).Activate
- For Each i In ActiveDocument.Paragraphs
- If i.Range Like "His[::]*" Then
- i.Range.Font.Color = wdColorRed
- i.Range.Copy
- doc.Activate
- Selection.EndKey Unit:=wdStory
- Selection.Paste
- End If
- Next
- doc.Paragraphs.Last.Range.Delete
- Documents(j).Close savechanges:=wdDoNotSaveChanges
- doc.Content.Find.Execute findtext:="His:", replacewith:="", Replace:=wdReplaceAll
- doc.Content.Find.Execute findtext:="His:", replacewith:="", Replace:=wdReplaceAll
- MsgBox "提取完毕!文档尚未保存,请自行保存!", vbOKOnly + vbExclamation, "提取感叹句"
- End Sub
复制代码 |
|