×
Menu
Index

3.6.4. Executing VBScript Before/After Export

 
 
This example shows how to run a vbs script before or/and after batch export
 
 
To setup these scripts:
 
 
 
These scripts allow us to make a loop to obtain data for the records that are exported or are going to be exported.
 
 
 
Set Batch = ChronoApp.GetCurrentBatch
 
Dim NumDocs
NumDocs=Batch.GetDocCount
 
'navigating records
For i = 0 To NumDocs-1
    If (Batch.IsValidated(i)) Then
        MsgBox "Document Subject: "+Batch.GetUserField( i, "Subject")
        MsgBox "Source file: "+Batch.GetUserField( i, "SrcDoc")
'Update Field "Export date" to current date
        Call Batch.SetUserField(i, "Export date", Date)
 
'navigate each page
 Set Doc = Batch.GetDocument (i)
        numpages=Doc.get_page_count()
        MsgBox numpages & " pages"
        For page = 1 To numpages
            'obtain source page file
            MsgBox Doc.get_page_field_value (page, "SrcFile")
        Next
 
 
    End If
Next
 
 
Dim NumExpFiles
NumExpFiles=Batch.GetConversionModule_FileCount("chronoscan pdf text conversion")
 
'navigating generated Documents
If NumExpFiles >0 Then
    For i = 0 To NumExpFiles-1
Dim file
        file=Batch.GetConversionModule_File(i,"chronoscan pdf text conversion")
        MsgBox "Exported file: "+file
    Next
End If
 
 
 
Notes:
 
"chronoscan pdf text conversion" is the configured conversion module's name