ann Level: Trainee
 Registered: 07-09-2006 Posts: 1
|
file save not exist..plz
ac'ly i just scan documents from scanner.
Then,load the doc in pictureBox name PicImage.
After that,i want to save that document as .jpg or .tif or .pdf .
i found this coding in a site..
i'm using this coding on my save button, but then its only generate the save as dialog box.
however no such file exists.. did someone know other method or what wrong with this coding?
Private Sub mnuSaveAsFile_Click()
' Sets the Dialog Title to Save File
CommonDialog1.DialogTitle = "Save File"
' Sets the File List box to Acobat Reader,TIFF File ,JPEG File
CommonDialog1.Filter = "Acobat Reader (*.pdf)|*.pdf|TIFF File (*.tif)|*.tif|JPEG File (*.jpg)|*.jpg|"
' Set the default files type to Acrobat Reader
CommonDialog1.FilterIndex = 1
' Sets the flags - Hide Read only, prompt to overwrite, and path must exist
CommonDialog1.flags = cdlOFNHideReadOnly + cdlOFNOverwritePrompt _
+ cdlOFNPathMustExist
' Set dialog box so an error occurs if the dialogbox is cancelled
CommonDialog1.CancelError = True
' Enables error handling to catch cancel error
On Error Resume Next
' display the dialog box
CommonDialog1.ShowSave
' This code runs if the dialog was cancelled
If Err Then
' Displays a message box.
MsgBox "Dialog Cancelled"
Exit Sub
End If
End Sub
tq
ann.
|