我在 ms-word 2007 中使用宏
我必须找到双字母。例如:苹果中的PP,访问中的cc和ss(来自“aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo,pp,qq,rr ,ss,tt,uu,vv,ww,xx,yy,zz") 并将上述双字母字体格式化为比例 - 75% ,间距 - 扩展 ,By - 0.5pt
我有 vb 代码来突出显示双字母,但我没有代码来选择并将上述双字母字体格式化为比例 - 75%,间距 - 扩展,按 - 0.5pt
Sub Macro_test()
'
' Macro_alphabet Macro
'
'
Application.ScreenUpdating = False
Dim StrFnd As String, Rng As Range, i As Long
StrFnd = "aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn,oo,pp,qq,rr,ss,tt,uu,vv,ww,xx,yy,zz"
For i = 0 To UBound(Split(StrFnd, ","))
Set Rng = ActiveDocument.Range
With Rng.Find
.ClearFormatting
.text = Split(StrFnd, ",")(i)
.Replacement.ClearFormatting
.Replacement.Highlight = True
.Replacement.text = "^&"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=wdReplaceAll
Selection.Range.HighlightColorIndex = wdNoHighlight
End With
Next
Set Rng = Nothing
Application.ScreenUpdating = True
End Sub