|
楼主,你的附件我觉得很好,不宜处理!我针对你的附件编了一个小宏,目的是删除《答案》到《考点》这些红色文字,之后就可以看无答案的 DOC 文档了!(至于循环遍历文件夹,先不要着急……)
- Sub test()
- 'Sub 删除手动换行符和假段落标记()
- ActiveDocument.Content.Find.Execute findtext:="^l", replacewith:="^p", Replace:=wdReplaceAll
- ActiveDocument.Content.Find.Execute findtext:="^13", replacewith:="^p", Replace:=wdReplaceAll
- '全文查找
- Selection.HomeKey Unit:=wdStory
- Selection.Find.ClearFormatting
- Do While Selection.Find.Execute(findtext:="【答案", Forward:=True)
- Do
- Selection.MoveEnd Unit:=wdCharacter, Count:=1
- Loop Until Selection Like "*考点:"
- Do
- Selection.MoveEnd Unit:=wdCharacter, Count:=1
- Loop Until Selection.Characters.Last = vbCr
- Selection.Delete
- Loop
- 'Sub 创建副本()
- ActiveDocument.SaveAs FileName:=Left(ActiveDocument.FullName, Len(ActiveDocument.FullName) - 4) & "_无答案"
- MsgBox "处理完毕!!!(文档已经保存!)"
-
- End Sub
复制代码 |
|