Tuesday, April 10, 2007

Hide a folder in FileNet Capture 4.1

Following VB subroutine can be used to hide a particular node in Capture Tree View control....
[Pass the name of node to be hidden]

Public Sub HideANode(strNode As String)
Dim oRO As RepObject
Dim goRepServer As RepServer

Set goRepServer = CreateObject("FileNET.Capture.RepServer.1")

On Error GoTo ErrExit
If Not goRepServer Is Nothing Then

Set oRO = goRepServer.Sessions(0).Repository.Contents.Item(strNode)
If Not oRO Is Nothing Then oRO.Hidden = True
End If
ErrExit:
End Sub

Create a folder using VB code in FileNet Tree View

Select a node under which you want to create a new folder and use following code on some event....


Dim lResult As Long
Dim NewFolder As RepObject
Dim OldFolder As RepObject
Dim ParentObj As RepObject

'let the user know that we are doing something
Me.MousePointer = vbHourglass
'Validate the folder name
If txtFolderName = "" Then
'no name specified, so return error
MsgBox "Enter Folder name"
txtFolderName.SetFocus
'ElseIf InStr(1, txtFolderName.Text, "/", vbBinaryCompare) <> 0 Then
'the slash is not allowed in the name
ElseIf ValidateFolderName(txtFolderName.Text) = False Then
'MsgBox strInvalidName, , strCreateFolderTitle
txtFolderName.SetFocus
txtFolderName.SelStart = 0
txtFolderName.SelLength = Len(txtFolderName.Text)
Else
'we have a good name
On Error GoTo ErrExit:

'we need to check if the name is already used
'Find the parent
Set ParentObj = Me.FNCaptureTree1.GetSelectedItem(0)
'see if there is a duplicate below the parent
Set OldFolder = ParentObj.Contents.Item(txtFolderName.Text)
If Not OldFolder Is Nothing Then
'we have a duplicate name so return an error
MsgBox "Duplicate folder is not allowed"
Set OldFolder = Nothing
frmCreateFolder.MousePointer = vbDefault
Exit Sub
End If

'create the new folder
Set NewFolder = ParentObj.Contents.Add("Folder", txtFolderName.Text)
'save it
lResult = NewFolder.Save
'unload our form

'refresh the treeview so the new folder shows up
Me.FNCaptureTree1.SelectItem ParentObj

End If
'let the user know were done
Me.MousePointer = vbDefault
Exit Sub
ErrExit:
txtFolderName.SetFocus
txtFolderName.SelStart = 0
txtFolderName.SelLength = Len(txtFolderName.Text)
Me.MousePointer = vbDefault

Copy any page at any location in FileNET Capture Control

'oPageSelected - is the selected page after which you want to copy a particular page(Say Barcode separator)

If Not oPageSelected Is Nothing Then
MsgBox "Page Name is " + oPageSelected.Name
End If
Dim oBarCodeSep As RepObject
Dim oRepServer As RepServer
Set oRepServer = CreateObject("FileNET.Capture.RepServer.1")

If Not oRepServer Is Nothing Then
Set oBarCodeSep = oRepServer.ObjectFromFullName "IS1:/BarCodePage")

Dim oDstParent As RepObject
Dim oRepObj As RepObject
Dim lResult As Long

Set oDstParent = oPageSelected.Owner
oDstParent.CopyFrom oBarCodeSep
Set oRepObj = oDstParent.Contents.Item(oDstParent.Contents.Count - 1)
lResult = oPageSelected.Move(oRepObj)
If lResult = 0 Then
MsgBox oRepObj.Name & strCanNotBeMovedTo & oDst.Name
Else

End If

End If

Monday, April 02, 2007

How to resolve 'Can not recognize format' FileNet DocProcessing Error.

Solution:

FileNet DocProcessing throws 'Can not recognize format' error when it does not find the enough free space on root drive.To resolve this error ensure the following things:
1). There must be enough space on C:\ drive.
2). Remove all the unnecessary files including Temporary files.
3). Restart the PC and try DocProcessing coponent on a batch.