Results 1 to 4 of 4

Thread: easy question?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Fremont Ohio 43420
    Posts
    253

    Talking

    I'm not very familiar with NT. Well my boss and I were testing a program before we actually let anyone run it and we found that when we tried to save the .txt would not show up on the file name. Does anyone have any suggestions on to why that happened?

    Thank you.

  2. #2
    Guest
    Post your saving routine. Maybe there's are error in it.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Fremont Ohio 43420
    Posts
    253

    posted saving routine

    Private Sub mnuFileSaveAs_Click()
    Dim fname As String
    Dim response As VbMsgBoxResult

    On Local Error GoTo errhandler
    CommonDialog1.CancelError = True
    CommonDialog1.Filter = "Text (*.txt)|*.txt|" 'You can add other File Names here
    CommonDialog1.ShowSave

    Open CommonDialog1.FileName For Output As #1
    Print #1, Text1.Text
    Close #1

    fname = CommonDialog1.FileName
    If Len(Dir(fname)) > 0 Then
    response = MsgBox("File already exists! Do you want to overwrite?", vbYesNo, "File Save As")
    If (response = 7) Then
    CommonDialog1.CancelError = True
    CommonDialog1.Filter = "Text (*.txt)|*.txt|" 'You can add other File Names here
    CommonDialog1.ShowSave

    Open CommonDialog1.FileName For Output As #1
    Print #1, Text1.Text
    Close #1
    End If
    End If

    errhandler:
    Exit Sub

    End Sub

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Fremont Ohio 43420
    Posts
    253
    Yeah I agree with the flags and they work great. Thanks.

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