J
jwaarnold
Alright, I am an accountant who has picked some VBA over the last 5
months to stay busy at work. I've spent 10-15 hours on this macro and
can't figure it out.
Here's the deal: I want to take a massive .tif file (1-3k pages) and
cut/paste pages into new .tif's(or .mbi's). I finally figured out the
search function (copy/paste from MSDN), but can't get it to cut and
paste. Here is the macro as I have it now. I would explain it, but I
don't really understand why it works.
Sub loopimages()
Dim miDoc As MODI.Document
Dim miSearch As MODI.MiDocSearch
Dim miTextSel As MODI.IMiSelectableItem
Dim strSearchInfo As String
Dim miImage As MODI.Image
Set miDoc = New MODI.Document
miDoc.Create "C:\scan.tif"
miDoc.OCR
Set miSearch = New MODI.MiDocSearch
miSearch.Initialize miDoc, "disbursement requisition", 0, 0, False,
False
miSearch.Search Nothing, miTextSel
If miTextSel.Words.Count <> 0 Then
MsgBox "success"
Else
MsgBox "failure"
End If
MsgBox strSearchInfo, vbInformation + vbOKOnly, _
"Search Information"
Set miTextSel = Nothing
Set miSearch = Nothing
Set miDoc = Nothing
End Sub
Right now it is searching for "disbursement requisition" on the first
page of c:\scan.tif.
Where I have the "success" msgbox, I want to cut & paste to a new .tif
file. I've tried using the copytoclipboard and (ugh) Sendkeys, but
can't get anything to work. Can anyone point me in the right
direction?
Thanks,
Jed
months to stay busy at work. I've spent 10-15 hours on this macro and
can't figure it out.
Here's the deal: I want to take a massive .tif file (1-3k pages) and
cut/paste pages into new .tif's(or .mbi's). I finally figured out the
search function (copy/paste from MSDN), but can't get it to cut and
paste. Here is the macro as I have it now. I would explain it, but I
don't really understand why it works.
Sub loopimages()
Dim miDoc As MODI.Document
Dim miSearch As MODI.MiDocSearch
Dim miTextSel As MODI.IMiSelectableItem
Dim strSearchInfo As String
Dim miImage As MODI.Image
Set miDoc = New MODI.Document
miDoc.Create "C:\scan.tif"
miDoc.OCR
Set miSearch = New MODI.MiDocSearch
miSearch.Initialize miDoc, "disbursement requisition", 0, 0, False,
False
miSearch.Search Nothing, miTextSel
If miTextSel.Words.Count <> 0 Then
MsgBox "success"
Else
MsgBox "failure"
End If
MsgBox strSearchInfo, vbInformation + vbOKOnly, _
"Search Information"
Set miTextSel = Nothing
Set miSearch = Nothing
Set miDoc = Nothing
End Sub
Right now it is searching for "disbursement requisition" on the first
page of c:\scan.tif.
Where I have the "success" msgbox, I want to cut & paste to a new .tif
file. I've tried using the copytoclipboard and (ugh) Sendkeys, but
can't get anything to work. Can anyone point me in the right
direction?
Thanks,
Jed