posting from a file

  • 15 years ago


    On Error GoTo errHandler
    With cd1
       .CancelError = False
       .DialogTitle = "Open"
       .Flags = cdlOFNHideReadOnly + cdlOFNPathMustExist + cdlOFNFileMustExist
       .Filter = "GSC Files (.gsc)|.gsc"
       .FileName = ""
    End With
       Open cd1.FileName For Input As #1
       Print #1, txtDocument.Text
       Close #1
      Exit Sub

    for some reason when i use commondialog1 to open a file it will not post into the txtdocument.text window at all...
    am i missing something here?


  • 15 years ago
    I've only just come back to work after the hols so haven't seen your post before now, apologies if I'm too late!!

    I believe your problem lies in the fact that you are opening the file for input but you are using the Print statement!

    It should read:

    Open cd1.FileName For Input As #1
    Line Input #1, txtDocument.Text
    Close #1



Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Some people, when confronted with a problem, think "I know, I’ll use regular expressions." Now they have two problems.” - Jamie Zawinski