Share via


Rectangle.RectangleType Property

Word Developer Reference

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

Syntax

expression.RectangleType

expression   Required. A variable that represents 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.

Visual Basic for Applications
  Dim objRectangle As Rectangle

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

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

See Also