VBA代码如下:
Sub AddPinYin()
Application.ScreenUpdating = False
Dim tintTreatingCount As Integer
Dim tstrCharA As String
Dim tlngCurPos As Long
Dim tintA As Integer
Selection.WholeStory
tstrText = Selection.Text
tintTextLength = Selection.Characters.Count
tintlinestart = 1
tintTreatingCount = 0
Selection.GoTo What:=wdGoToHeading, Which:=wdGoToAbsolute, Count:=1
Selection.MoveRight unit:=wdCharacter, Count:=1, Extend:=wdExtend
Selection.GoTo What:=wdGoToHeading, Which:=wdGoToAbsolute, Count:=1
For tintloopx = 1 To tintTextLength
tlngCurPos = Selection.MoveRight(unit:=wdCharacter, Count:=1, Extend:=wdExtend)
tstrCharA = Right(Selection.Text, 1)
If AscW(tstrCharA) < 255 And AscW(tstrCharA) > -255 Then