Home > Language Reference > Windows Management Functions > ClickScrollBar

ClickScrollBar

The ClickScrollBar function simulates a scrollbar click.

Usage

Prefer to automate a Page Down (using SendKeys ("<PageDown>") statement) as a scrollbar click is not precise.

Syntax

ret=ClickScrollBar (<scrollbar_name>, <count>, line|pg|abs)

Parameters

<scrollbar_name>, string, scrollbar identifier.

<count>, integer, number of scrolls. If the next parameter is abs, <count> is positive starting at 0, if the next parameter equals pg or line, <count> simulates relative scrolls and can be negative or positive.

line|pg|abs, keyword. Use line for scrolling by lines, pg for scrolling by pages, and abs for absolute positioning.

Return value

ret, optional numeric return value. If the scrollbar has been successfully clicked within 30 seconds (this default value can be changed using #ActionTimeout, the function returns 0. If the function fails, the return value is a nonzero value (see Window Functions Error Codes).

Remarks

ClickScrollBar function is used when the scrollbar is a separate control within the last window specified by the most recent UseWindow. If the scrollbar is part of the last window specified by the most recent UseWindow, WinScrollBar function is used.

See also

WinScrollBar

Example

'Click one page down in Word scrollbar
UseWindow("WINWORD.EXE|_WwB|Document1",1)
 ClickScrollBar("1",0,ABS)