|
* 楼主,请保存好你的原版文档,然后复制一份再应用下面的宏试试:(宏每次会自动备份原文件)
- Sub a0222_CopyText()
- 'CopyFile
- Dim oldName$, newName$, l!
- l = Timer
-
- oldName = ActiveDocument.FullName
-
- If oldName Like "*.docx" Then
- newName = Left(oldName, Len(oldName) - 5) & "_Copy" & ".docx"
- Else
- newName = Left(oldName, Len(oldName) - 4) & "_Copy" & ".doc"
- End If
-
- ActiveDocument.Close 0
- FileCopy oldName, newName
-
- Documents.Open FileName:=newName
-
- ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitBestFit
-
- 'DeleteLines
- Dim i As Paragraph
- For Each i In ActiveDocument.Paragraphs
- With i.Range
- If Not .Characters.Count = 6 Then .Delete
- End With
- Next
- ActiveDocument.Save
-
- MsgBox "File Saved!" & vbCr & "Cost Time = " & Timer - l & " Seconds.", 0 + 48
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|