Group:  Microsoft Access ยป microsoft.public.access.activexcontrol
Thread: Image scan using MODI

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Image scan using MODI
Daniel 19.11.2005 22:01:02
Hi,

I'm using windws imaging 2 to scan docoments in my application.
The scan runs ok and a TIF file is created.
The problem is when i'm trying to copy the file to another directory from
within the application - i get error 70: Permission denied

The form that scanned the document is closed after scanning. Here's the code:

-- DocViewer is an activex object used to display the file

Private Sub ScanBtn_Click()
Set MainDoc = New MODI.Document
ScanDocName = "Tmp.TIF"
MainDoc.Create
MainDoc.Images.Add ScanImage(), Nothing
Me.DocViewer.Document = MainDoc
End Sub


Public Function ScanImage() As MODI.Image
Dim tmpDoc As New Document
Dim TmpImg As WIA.ImageFile
Dim s As String

Set TmpImg = ScanPage(Me.ImgQty)
s = NewFileName(TmpImg.FileExtension)
TmpImg.SaveFile s
Set TmpImg = Nothing
tmpDoc.Create s
Set ScanImage = tmpDoc.Images(0)
Me.ScanedPages = PageCount
tmpDoc.Close True
Set tmpDoc = Nothing

End Function

Public Function ScanPage(Optional Quality As Integer = -1) As WIA.ImageFile
On Error GoTo Finish
Dim DevDlg As New WIA.CommonDialog
Set ScanPage = CreateObject("WIA.ImageFile")
Set ScanPage = DevDlg.ShowAcquireImage(ScannerDeviceType, UnspecifiedIntent,
MinimizeSize, wiaFormatJPEG, False, True)
Set DevDlg = Nothing
Exit Function
Finish:
ScanPage = Nothing
End Function



please help....
Re: Image scan using MODI
"Alex Dybenko" <alexdyb[ at ]PLEASE.cemi.NO.rssi.SPAM.ru> 20.11.2005 13:26:39
Hi,
just a guess - try to saveAS document to a new path, and then delete
original.

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


"Daniel" <Daniel[ at ]discussions.microsoft.com> wrote in message
news:B6269D9C-880D-4E59-9E0B-10740DA0CA34[ at ]microsoft.com...
[Quoted Text]
> Hi,
>
> I'm using windws imaging 2 to scan docoments in my application.
> The scan runs ok and a TIF file is created.
> The problem is when i'm trying to copy the file to another directory from
> within the application - i get error 70: Permission denied
>
> The form that scanned the document is closed after scanning. Here's the
> code:
>
> -- DocViewer is an activex object used to display the file
>
> Private Sub ScanBtn_Click()
> Set MainDoc = New MODI.Document
> ScanDocName = "Tmp.TIF"
> MainDoc.Create
> MainDoc.Images.Add ScanImage(), Nothing
> Me.DocViewer.Document = MainDoc
> End Sub
>
>
> Public Function ScanImage() As MODI.Image
> Dim tmpDoc As New Document
> Dim TmpImg As WIA.ImageFile
> Dim s As String
>
> Set TmpImg = ScanPage(Me.ImgQty)
> s = NewFileName(TmpImg.FileExtension)
> TmpImg.SaveFile s
> Set TmpImg = Nothing
> tmpDoc.Create s
> Set ScanImage = tmpDoc.Images(0)
> Me.ScanedPages = PageCount
> tmpDoc.Close True
> Set tmpDoc = Nothing
>
> End Function
>
> Public Function ScanPage(Optional Quality As Integer = -1) As
> WIA.ImageFile
> On Error GoTo Finish
> Dim DevDlg As New WIA.CommonDialog
> Set ScanPage = CreateObject("WIA.ImageFile")
> Set ScanPage = DevDlg.ShowAcquireImage(ScannerDeviceType,
> UnspecifiedIntent,
> MinimizeSize, wiaFormatJPEG, False, True)
> Set DevDlg = Nothing
> Exit Function
> Finish:
> ScanPage = Nothing
> End Function
>
>
>
> please help....

Re: Image scan using MODI
Daniel 20.11.2005 16:40:02

Thanks for your response.

Even when I'm saving the document as numeros files:
Doc.SaveAs "F1.TIF"
Doc.SaveAs "F2.TIF"

All files are locked until I quit the application.

Is there a way to open them for Read Only - just to copy ?

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net