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....
|