RectangleType Property

Microsoft Word Visual Basic

Show All Show All

RectangleType Property

Returns a WdRectangleType constant that represents the type for the specified rectangle.

wdRectangleType can be one of the following WdRectangleType constants.

wdLineBetweenColumnRectangleRepresents a region corresponding to a line that separates columns.
wdMarkupRectangleRepresents a space occupied by a comment balloon.
wdMarkupRectangleButtonRepresents a space occupied by the more (...) indicator that appears in a comment balloon when there is additional text for the comment.
wdPageBorderRectangleRepresents a space occupied by a page border.
wdSelectionRepresents a space occupied by a selection tool, for example the table selection tool in the upper left corner of a table or the anchor for an image.
wdShapeRectangleRepresents a space occupied by a shape.
wdSystemNot applicable.
wdTextRectangleRepresents a space occupied by text.

expression.RectangleType

expression    Required. An expression that returns a Rectangle object.

Remarks

Rectangles in Microsoft Word are sections within a page in a document that contain specific types of information. Some sections are portions of text; others are shapes. The purpose of rectangles is to allow more control over programmatic page layout.

Example

The following example accesses the first rectangle on the first page in the active document, and if it is a text rectangle, checks the spelling.

    Dim objRectangle As Rectangle

Set objRectangle = ActiveDocument.ActiveWindow _
    .Panes(1).Pages(1).Rectangles(1)

If objRectangle.RectangleType = wdTextRectangle Then
    objRectangle.Range.CheckSpelling
End If