俺也琢磨了一个,但是不能完成频率统计.请指教.
sub初学()
Selection.HomeKey Unit:=wdStory '光标回到最开始
Dim a As String, b As String
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Copy
a = Selection.text
Selection.MoveRight Unit:=wdCharacter, Count:=1
Do
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.Copy
b = Selection.text
If a <> b Then
' Selection.MoveRight Unit:=wdCharacter, Count:=1
' Selection.TypeParagraph
' Else
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeParagraph ' 插入回车符
Else
Selection.MoveRight Unit:=wdCharacter, Count:=1
End If
a = b
Loop Until b = "停" '调处循环的设置很笨,是人为在最后加一个字,请修改
end sub()
|