GetDocScrollPositions method

The current scroll positions are returned in the specified variables.

Method
short GetDocScrollPositions(
  • VARIANT * pHorzPosition,
  • VARIANT * pVertPosition )
Parameters
pHorzPosition
Points to a variable to receive the new horizontal scroll position. On return, this variable is set to type VT_I2.
pVertPosition
Points to a variable to receive the new vertical scroll position. On return, this variable is set to type VT_I2.
Description
The scroll positions assume that the scroll ranges have been set to ARS_OLE_SCROLL_RANGE.
Return Value
Refer to return codes.

C/C + +

The following example sets the current page number of the open document and updates the current scroll positions.
 CArsOle * pArsCtrl;
 CScrollBar * pHorzScollBar, * pVertScrollBar;
 short rc;
 VARIANT horz_position, vert_position;
   .
   .
  rc = pArsCtrl->SetDocCurrentPage( 46 );
  if ( rc != ARS_OLE_RC_SUCCESS )
    ERROR;
   .
   .

 rc = pArsCtrl->GetDocScrollPositions( &horz_position, &vert_position );
 if ( rc != ARS_OLE_RC_SUCCESS )
   ERROR;

 pHorzScrollBar->SetScrollPos( (int)horz_position.iVal );
 pVertScrollBar->SetScrollPos( (int)vert_position.iVal );
   .
   .

Visual Basic

Dim rc As Integer
Dim horz_pos, vert_post As Variant

 .
 .

rc = ArsOle.SetDocCurrentPage( 46 )
If rc <> ARS_OLE_RC_SUCCESS Then
   MsgBox "ERROR"
   End
End If

rc = ArsOle.GetDocScrollPositions( horz_pos, vert_pos )
If rc <> ARS_OLE_RC_SUCCESS Then
   MsgBox "ERROR"
   End
End If

sbHorz.Value = horz_pos
sbVert.Value = vert_pos

 .
 .