asked on
Private Sub doc_onOCRProgress(byval progress as long)
me.progressbar1.value = progress
end sub
'now i know that progress has to equal something, but what?
ASKER
Option Explicit On
Imports System.Windows.Forms
Imports MODI
Public Class ocr
Private WithEvents doc As MODI.Document
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim input As String = "c:\newtif.tif"
doc = New MODI.Document
doc.Create(input)
Me.Cursor = Cursors.WaitCursor
doc.OCR()
doc.Save()
Me.Cursor = Cursors.Default
doc.Close()
doc = Nothing
MessageBox.Show("Optical Character Recognition Complete", "Conversion Complete", MessageBoxButtons.OK, MessageBoxIcon.Information)
Me.Close()
End Sub
Private Sub Doc_OnOCRProgress(ByVal Progress As Long)
Dim ctr As Long
For ctr = 1 To Progress
ProgressBar1.Value = ctr
Next
ProgressBar1.Maximum = Progress
End Sub
End Class
ASKER
Option Explicit
Private WithEvents mmiDoc As MODI.Document
Private mblnCancel As Boolean
Private Sub cmdCancel_Click()
' Set a flag indicating that the user wants to cancel.
mblnCancel = True
End Sub
Private Sub cmdOCR_Click()
' Load an existing TIF file.
Set mmiDoc = New MODI.Document
mmiDoc.Create "C:\document1.tif"
' Perform OCR on the document
Screen.MousePointer = vbHourglass
mmiDoc.OCR
Screen.MousePointer = vbDefault
Set mmiDoc = Nothing
End Sub
Private Sub mmiDoc_OnOCRProgress(ByVal Progress As Long, _
Cancel As Boolean)
' Cancel if user has clicked the Cancel button.
If mblnCancel Then
Cancel = True
End If
' Indicate progress on the ProgressBar control
pbrOCRProgress.Value = Progress
End Sub
ASKER
ASKER
ASKER
ASKER
ASKER
Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.
TRUSTED BY
ASKER
Thanks for the reply