writing to a txt file from a text box

Posted on 2003-04-01
Medium Priority
Last Modified: 2010-05-01
How do I take text from a textbox and write it to a txt file
Question by:jrisi03
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 18

Expert Comment

ID: 8247449
Dim ff as integer
ff = FreeFile
open "C:\my documents\outputfile.txt" For Output as #ff
Print #ff, text1.text
LVL 11

Accepted Solution

supunr earned 60 total points
ID: 8249962
if you use a richtextbox, then it is very simple.

to save text....
RichTextBox1.SaveFile "C:\Mydata.txt", rtfText

to load text...
RichTextBox1.LoadFile "C:\Mydata.txt", rtfText

' Good Luck!

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question