Size Property

Microsoft Publisher Visual Basic

Returns or sets a Long that represents the number of lines high to format a dropped capital letter. Read/write.

expression.Size

expression    Required. An expression that returns one of the above objects.

ShowSize property as it applies to the Font object.

Returns or sets a Variant that represents the size of the characters in the text range in points. Read/write.

expression.Size

expression    Required. An expression that returns one of the above objects.

Remarks

The valid range for the Size property is 0.5 points to 999.5 points. The Size property returns –2 if the size of characters is indeterminate.

Example

ShowAs it applies to the DropCap object.

This example formats a drop cap for the specified text range that is five lines high.

Sub RaisedDropCap()
    Dim intCount As Integer
    With ActiveDocument.Pages(1).Shapes _
            .AddTextbox(Orientation:=pbTextOrientationHorizontal, _
            Left:=100, Top:=100, Width:=100, Height:=100) _
            .TextFrame.TextRange
        For intCount = 1 To 10
            .InsertAfter NewText:="This is a test. "
        Next intCount
        With .DropCap
            .Size = 5
            .LinesUp = 2
        End With
    End With
End Sub
				

ShowAs it applies to the Font object.

This example inserts text and then sets the font size of the seventh word of the inserted text to 20 points.

Sub IncreaseFontSizeOfSelection()
    With Selection.TextRange
        .InsertBefore vbLf & "This is a demonstration of font size."
        .Words(7).Font.Size = 20
    End With
End Sub