本帖最后由 lss001 于 2020-2-14 23:06 编辑
Sub WordjzPY() 'Word批量加注拼音 On Error Resume Next Selection.WholeStory Selection.Font.Size = CByte(22) '设置字体大小 TextLength = Selection.Characters.Count Selection.EndKey For i = TextLength To 0 Step -30 If i <= 30 Then Selection.MoveLeft Unit:=wdCharacter, Count:=i SelectText = Selection.MoveRight(Unit:=wdCharacter, Count:=i,Extend:=wdExtend) Else Selection.MoveLeft Unit:=wdCharacter, Count:=30 SelectText = Selection.MoveRight(Unit:=wdCharacter, Count:=30,Extend:=wdExtend) End If SendKeys "{Enter}" Application.Run "FormatPhoneticGuide" 'Application.Dialogs(wdDialogPhoneticGuide).Show '986 Next Selection.Font.Size = CByte(11) '返回字体大小
End Sub Sub WordqcPY() 'Word批量清除拼音 'Line: Application.ScreenUpdating = False Selection.WholeStory TextLength = Selection.Characters.Count Selection.GoTo What:=wdGoToHeading, Which:=wdGoToAbsolute, Count:=1 For i = 0 To TextLength With Selection .Range.PhoneticGuide Text:="", _ Alignment:=wdPhoneticGuideAlignmentOneTwoOne, _ Raise:=11, FontSize:=8, FontName:="MS Gothic" End With Selection.MoveRight Unit:=wdCharacter, Count:=1 Next Selection.WholeStory 'If Selection.Characters.Count > TextLength Then GoTo Line Application.ScreenUpdating = True
End Sub
|