SetDocCurrentPage method

The current page number of the open document is set to the specified page and the control window is repainted with the data for that page.

Method
short SetDocCurrentPage(
long page )
Parameters
page
Specifies the page number to be made the current page number of the open document.
Description
The current page number of the open document is set to the specified page and the control window is repainted with the data for that page.
Return Value
Refer to return codes.
See Also
GetDocCurrentPage, and GetDocNumPages method

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->GetDocScrollPosition( &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

 .
 .