Saving Text from a Rich Text Box

Hello first time on the forums but Ill get straight to my issue. Im currently attempting to build a Windows Form application to log IT complaints in the office where I work. The issue im having is getting the information entered into a rich text box by the user to be saved into a word/text document for the IT department to read. Here is a brief look at what I have so far.

Public: Form1(void)
{
InitializeComponent();
}

Private : void button1_Click(Object sender, EventArgs e)
{
richTextBox1->SaveFile(textBox1.text, RichTextBoxStreamType::PlainText);
}


The errors Im receiving state that:

Error C2228: left of .txt must have class/struct/union
Error C2065: textBox1 : undeclared identifier

Any help anyone could give on this issue is GREATLY appreciated, Im still relatively new to C++. Thanks in advance.
Last edited on
Have you tried putting the filename inside double quotes?

richTextBox1->SaveFile("textBox1.text", RichTextBoxStreamType::PlainText);
Hey Peter thanks for the speedy reply. Ive added the double quotes. The form now opens. However it is not creating/saving the information I enter into the rich text box. Could there be something else wrong?
Does anybody else have any idea whats wrong? Im still having the same issue where it isnt creating the file. It now loads the form but the textfile is not created so thus what it entered into the rich text box isnt being saved. Any ideas anyone?

Many thanks in advance.
Topic archived. No new replies allowed.