RetrieveDoc method

The data for the indicated document and its associated resource group, if any, are retrieved from the Content Manager OnDemand database and written to the indicated files.

Method
short RetrieveDoc(
long Index,
char * pDocPath,
char * pResGrpPath,
char * pCombinedPath )
Parameters
Index
Specifies the zero-based index of a document within the document list of the active folder.
pDocPath
Points to a null-terminated character string containing the fully-qualified path of a file to contain the document data. If this parameter is NULL, no data is written.
pResGrpPath
Points to a null-terminated character string containing the fully-qualified path of a file to contain the resource group data. If this parameter is NULL, no data is written.
pCombinedPath
Points to a null-terminated character string containing the fully-qualified path of a file to contain the combined resource group and document data. If this parameter is NULL, no data is written.
Description
If any of the files already exist, the data is appended to the files. In the combined file, the data for the document is placed after the data for the resource group. Any combination of pDocPath,pResGrpPath, and pCombinedPath might be specified.

The document retrieval can be cancelled by using the CancelOperation method. If a cancel facility is made available to the user, it might be desirable to call the RetrieveDoc method on a background thread and allow the user interface thread to monitor the cancellation signal.

Return Value
Refer to return codes.
See Also
GetNumDocsInList, and SetResourceCacheMode methods

C/C + +

The following example retrieves the data for all files in a document list, copying all document data to one file and the resource group data to a different file.
 CArsOle * pArsCtrl;
 long num_docs, doc_num;
 short rc;
   .
   .
 rc = pArsCtrl->GetNumDocsInList( &num_docs );
 if ( rc != ARS_OLE_RC_SUCCESS )
   ERROR;

 for ( doc_num = 0; doc_num < num_docs; doc_num++ )
 {
   rc = pArsCtrl->RetrieveDoc( doc_num,
                               "C:\\FILES\\DATA.DOC",
                               doc_num == 0 ? "C:\\FILES\\DATA.RG" : NULL,
                               NULL );
   if ( rc != ARS_OLE_RC_SUCCESS )
     ERROR;
 }
   .
   .

Visual Basic

Dim rc, count As Integer
Dim num_docs As Variant

 .
 .

rc = ArsOle.GetNumDocsInList (num_docs)
If rc <> ARS_OLE_RC_SUCCESS Then
    MsgBox "ERROR"
    End
End If

For count = 0 To num_docs - 1
    If count = 0 Then
        rc = ArsOle.RetrieveDoc (count, _
                                 "C:\FILES\DATA.DOC", _
                                 "C:\FILES\DATA.RG", _
                                 "")
        If rc <> ARS_OLE_RC_SUCCESS Then
            MsgBox "ERROR"
            End
        End If
    Else
        rc = ArsOle.RetrieveDoc (count, _
                                 "C:\FILES\DATA.DOC", _
                                 "", _
                                 "")
        If rc <> ARS_OLE_RC_SUCCESS Then
            MsgBox "ERROR"
            End
        End If
    End If
Next count

 .
 .