Results 1 to 2 of 2

Thread: SOMEONE PLEASE HELP ME...

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    18
    How do I code a Save routine for a common dialog control ? I want to save the text from a text box to a file. I can make the Save as dialog appear but I don't know where and what to put for the save...

    Any hint, code or examples will be appreciated...

    Hemang

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    This code open a file for output and writes the contents of a textbox (named Text1)
    Code:
    Dim sFileName As String, iFile as Integer
    With CommonDialog1
        .Flags = cdlOfnPathMustExist + cdlOfnOverWritePrompt
        .CancelError = True
        On Error Resume Next
        Err.Clear
        .ShowSave
        If Err <> cdlCancel Then
            iFile = FreeFile
            sFileName = .FileName
            Open sFileName For Output As #iFile
            Print #iFile, Text1.Text
            Close #iFile
        End If
    End With
    Good luck!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width