Monday, June 09, 2008

Compare number ranges in ABBYY FlexiCapture

 

vbscript

 

dim val, val1

val = me.Field("Field1").Value

val1 = CInt(val)

 

if val1 >= 1.00 and val1 <= 32.47 then

                me.Field("Field2").Value = "text"

else if val1 >= 32.48 and val1 <= 58.63 then

                me.Field("Field2").Value = "text"

else if val1 >= 58.64 and val1 <= 70.19 then

                me.Field("Field2").Value = "text"

else if val1 >= 70.20 and val1<= 77.71 then

                me.Field("Field2").Value = "text"

else if val1 >= 77.72 and val1 <= 100 then

                me.Field("Field2").Value = "text"

end if

Monday, June 09, 2008 8:33:55 AM (Mountain Standard Time, UTC-07:00)  #    Comments [0]  | 
Wednesday, March 26, 2008

Restrict search area to a sliver next to a label:

          rightof:label;

          above:label.bottom,-20*dot;

          below:label.top,-20*dot;

 

Only grab a capture element if the label element is found:

          if label.isnull then dontfind;

 

Select the capture element closest to a label element:

          nearest:label;

 

Select the label element closest to the top of the page:

          nearesty:pagerect.top;

 

Select the label element closest to the bottom of the page

          nearesty:pagerect.bottom;

 

Limit the search area to the top half of the page:

          above:pagerect.bottom/2;

 

Limit the search area to the upper right hand quadrant of the page:

          above:pagerect.bottom/2;

          rightof:pagerect.right/2;

 

Choose between two capture areas, combine the results in a third:

          if not firstchoice.isnull then

          restrictsearcharea(firstchoice.rect);

          else if not secondchoice.isnull then

          restrictsearcharea(secondchoice.rect);

          end if

 

Choose between n capture areas:

          if not firstchoice.isnull then

          restrictsearcharea(firstchoice.rect);

          else if not secondchoice.isnull then

          restrictsearcharea(secondchoice.rect);

          else if not thirdchoice.isnull then

          restrictsearcharea(thirdchoice.rect);

          .

          .

          .        

          else if not lastchoice.isnull then

          restrictsearcharea(lastchoice.rect);

          else dontfind;

          end if

 

Expand table borders:

          exactcolumnborders(labelfield.left,-30*dot,labelfield.right,-30*dot,block.tablename.columnname);

Wednesday, March 26, 2008 1:30:52 PM (Mountain Standard Time, UTC-07:00)  #    Comments [0]  | 
Thursday, February 14, 2008

vbscript

 

If me.Field("field1").Value = “text”

Thursday, February 14, 2008 9:38:41 AM (Mountain Standard Time, UTC-07:00)  #    Comments [0]  | 
Monday, January 21, 2008

Here are two rules that you should find useful. Remember if you are modifying a field, make sure it is not marked “Read-Only”! More rules to come:

 

Date Normalization in VBScript
On Error Resume Next
me.FIELD(“InvoiceDate”).Value = FormatDateTime(me.FIELD(“InvoiceDate”).Value, vbGeneralDate )
If Err.Number 0 Then
    me.ERRORMESSAGE = “Error, Date is in Invalid Format”
    me.CHECKSUCCEEDED = False
End If

 

Type Conversion, Numerical Compare in VBScript
Dim AIValue, temp
On Error Resume Next
temp = me.Field(“AnnualIncome”).VALUE
If Err.Number 0 Then
    me.ERRORMESSAGE = “Error, Income is in Invalid Format”
    me.CHECKSUCCEEDED = False
End If
AIValue = temp + 0
if AIValue > 1500 then
    me.CheckSucceeded = true
else
    me.ErrorMessage = “Warning! Low annual income”
    me.CheckSucceeded = false
    me.FOCUSEDFIELD = me.FIELD(“AnnualIncome”)
end if

Monday, January 21, 2008 2:35:23 PM (Mountain Standard Time, UTC-07:00)  #    Comments [0]  | 

Pick a theme: