borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Problem with IE7 when using WinInet.dll)Next Topic (WININET timeout problem) New Topic New Poll Post Reply
AndreaVB Forum : API : file save not exist..plz
Poster Message
ann
Level: Trainee

Registered: 07-09-2006
Posts: 1

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

07-09-2006 at 08:17 AM
View Profile Send Email to User Show All Posts | Quote Reply
admin
Level: Administrator


Registered: 04-04-2002
Posts: 530
icon Re: file save not exist..plz

do you want to automatically save the document with a progressive number or do you want the user to enter the file name?

the save as dialog box only sets its FileName property as the user entered it, you can retrieve it by testing the CommonDialog1.FileName then you'll need to write the code to save your image with the filename entered by the user

____________________________
AndreaVB

25-10-2006 at 07:09 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : API : file save not exist..plz
Previous Topic (Problem with IE7 when using WinInet.dll)Next Topic (WININET timeout problem) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder