DrawSetRange, DrawSetRange()

Syntax

DrawSetRange Bookmark$

DrawSetRange(Bookmark$)

Remarks

The DrawSetRange statement sets the drawing range to the bookmark specified by Bookmark$. A drawing range establishes the group of drawing objects that other drawing statements and functions operate on. For example, the DrawCount() function counts the number of drawing objects whose anchors are within the drawing range.

The DrawSetRange() function behaves the same as the statement and also returns –1 if the range was set or 0 (zero) if the range was not set (for example, if the specified bookmark does not exist).

It is often convenient to use predefined bookmarks when setting a drawing range. For example, you can set the drawing range to the entire document by using the instruction DrawSetRange "\Doc". For more information on predefined bookmarks, see "Operators and Predefined Bookmarks" later in this part.

Example

This example sets the drawing range to the current page, counts the number of drawing objects within the range, and then displays a message box with the result:


DrawSetRange "\Page"
n = DrawCount()
MsgBox "The current page contains" + Str$(n) + " drawing object(s)."

See Also

DrawClearRange, DrawCount(), DrawSelect