Folder operations
The following Batch restructuring operations are available for the folder object.
Create a folder
Batch.CreateFolder(ByVal pParentXFolder As CscXFolder) As Long
Batch.CreateFolderFromDocument(ByVal pParentXFolder As CscXFolder, ByVal DocIndex As Long) As Long
Batch.CreateFolderFromDocumentTo(ByVal pParentXFolder As CscXFolder, ByVal DocIndex As Long, ByVal ToIndex As Long) As Long
An empty folder can be created in the specified parent folder (pParentXFolder) and documents can be moved into it afterwards. Initially the created folder is set to invalid.
Additionally, a folder can be created from an existing document (DocIndex) with or without specifying the position (ToIndex) of the new folder in the parent folder by applying CreateFolderFromDocument or CreateFolderFromDocumentTo. Initially the original parent folder of the document and the created folder the document is moved to are set to invalid.
For all methods the level the folder is created for must exist.
Delete a folder
DeleteFolder(ByVal pParentXFolder As CscXFolder, ByVal FolderIndex As Long)
Deletes the specified folder (FolderIndex) from its parent folder (pParentXFolder) with all sub folders and documents inside. Initially the parent folder of the deleted folder is set to invalid.
Merge folders
Batch.MergeFolders(ByVal pFirstXFolder As CscXFolder, ByVal pSecondXFolder As CscXFolder)
A folder (pSecondXFolder) can be merged to another folder (pFirstXFolder) when it is on the same folder level. The documents of the second XFolder are appended to the documents list of the first XFolder and the sub folders of the second folder are appended to the sub folders list of the first folder. Initially the merged folder is getting invalid. If the first and the second folder do not have the same parent folder the second folder is removed from its parent folder then that folder is also set to invalid.
Move a folder
MoveFolder(ByVal pParentXFolder As CscXFolder, ByVal FromIndex As Long, ByVal ToIndex As Long)
MoveFolderTo(ByVal pFromParentXFolder As CscXFolder, ByVal FromIndex As Long, ByVal pToParentXFolder As CscXFolder, ByVal ToIndex As Long)
A folder (FromIndex) can be moved inside its parent folder (pParentXFolder), or by applying MoveFolderTo to another parent folder (pToParentXFolder) to a specified position (ToIndex) as long as it stays on the same folder level. Initially the move operation is setting all involved parent folders to invalid.
Split a folder
Batch.SplitFolderBeforeDocument(ByValpParentXFolder As CscXFolder, ByVal DocIndex As Long)
Batch.SplitFolderBeforeFolder(ByVal pParentXFolder As CscXFolder, ByVal FolderIndex As Long)
A folder (pParentXFolder) can be split before a specified document or before a specified folder. If splitting before a document one folder contains all documents before the specified document and the other one the specified document, all documents after that and all sub folders if present. If splitting before a folder, one folder contains all documents of the original folder and all sub folders before the specified one and the other folder the specified folder and all following sub folders if present. Initially the split folders are set to invalid.
Modifying folder fields
oXFolder.Fields.ItemByName("MyField").Text = "MyNewText"
During batch restructuring it is allowed to change folder fields. These changes are synchronized back to Kofax Capture. By default, the validation of the batch is re-executed after batch restructuring so that the fields are checked against the defined formatting and validation rules.