Font.Grow 方法 (Publisher)

将字号增大为下一个可用的字号。

语法

表达式成长

表达 一个代表 Font 对象的变量。

备注

如果所选内容或范围包含多种字号,则将每一个字号都增大为下一个可用的设置。

示例

以下示例增大新文本框中第四个单词的字号。

Sub GrowFont() 
 Dim shpText As Shape 
 Dim intResponse As Integer 
 
 Set shpText = ActiveDocument.Pages(1).Shapes.AddTextbox( _ 
 Orientation:=pbTextOrientationHorizontal, Left:=100, _ 
 Top:=100, Width:=200, Height:=100) 
 
 With shpText.TextFrame.TextRange 
 .Text = "This is a test of the Grow method." 
 Do Until intResponse = vbNo 
 intResponse = MsgBox("Do you want to increase the " & _ 
 "size of the font?", vbYesNo) 
 If intResponse = vbYes Then 
 .Words(4).Font.Grow 
 End If 
 Loop 
 End With 
End Sub

以下示例增大选定文本的字号。

Sub IncreaseFontSizeOfSelectedText() 
 If Selection.Type = pbSelectionText Then 
 Selection.TextRange.Font.Grow 
 Else 
 MsgBox "You need to select some text." 
 End If 
End Sub

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。