Saving textbox as .txt file

ok what i am attempting im sure if fairly simple...im i trying

to save a text box inside a form as a .txt file

i would prefer the "save as" window than the save window..thanks if anyone can help,


Ant-


Comments

  • : ok what i am attempting im sure if fairly simple...im i trying

    : to save a text box inside a form as a .txt file

    : i would prefer the "save as" window than the save window..thanks if anyone can help,


    Have you tryed to use commondialog ??

    Check the VBhelp for more info. Search for commondialog.

    Hope that helped.






  • By "Save As" window instead of "Save" window. I assume you mean CMDialog? It has a setting to change the caption of the window. All CMDialog does is return a filename.


    This is VB3 code, you didn't specify a version.


    You can expand on this to suit your needs.


    CMDialog1.DialogTitle = "Save As" 'which is the default for that action

    CMdialog1.Action = 2 'setting to open a Save As dialog

    FileToSave = CMDialog1.FileName '.FileName returns the path and name of the selected file

    FileText = Text1.Text

    Open FileToSave for output as 1

    Print #1, FileText

    Close


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories