2013-11-28 360 views
1

我想將不等於9的字體大小更改爲9. 但彈出「編譯錯誤:預期表達式」。使用Word VBA更改字體大小

Sub FindReplaceStyle() 

With ActiveDocument.Content.Find 
    .ClearFormatting 

    With .Font 
     .Size <> 9 
    End With 

    .Format = True 

    With .Replacement 
     .ClearFormatting 
     With .Font 
      .Size = 9 
     End With 
    End With 

    .Execute Forward:=True, Replace:=wdReplaceAll, _ 
     FindText:="", ReplaceWith:="" 
End With 

End Sub 

回答

0

@ user2830554:<>是有條件的經營者,所以你不能沒有條件語句中使用它