既然COFE兄想利用VBA解决问题,你可以录入宏,还是替换的法子,也能做到。我想COFE兄不是这个意思。 这是我前时做了一个,不是很慎密,但对于这类问题应该可以解决,注意它不会变成段落。(即不修改原有段落) 请将以下代码粘贴于活动文档的‘’THIS DOCUMENT“ 模块下: Sub Linecount()
Dim i As Integer, Linecount As Integer, Range1 As Long, Range2 As Range, l As String
On Error Resume Next
Application.ScreenUpdating = False
CommandBars("Word Count").Visible = True
CommandBars("word count").Controls(2).Execute
l = CommandBars("word count").Controls(1).List(6)
CommandBars("Word Count").Visible = False
Application.ScreenUpdating = True
Linecount = Int(Mid(l, 1, Len(l) - 1))
'MsgBox Linecount
Range(0, 0).Select
For i = 1 To Linecount
Range1 = Selection.Start
Selection.EndKey Unit:=wdLine
If Range2 = Range1 Then
Selection.Delete
End If
Selection.GoToNext (wdGoToLine)
Next
End Sub
|