Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Who knows how to use richTextBox.SaveFile?

Status
Not open for further replies.

seanbo

Programmer
Jun 6, 2003
407
GB
i get this error...

An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll

Additional information: Object reference not set to an instance of an object.

...when this method...

private void menuItem4_Click(object sender, System.EventArgs e){
richTextBox1.SaveFile("C:/Documents and Settings/All Users/Desktop/save test.rtf");
}

...is run. all i want to do is save the contents of richTextBox1 (a rich text box). help please.
 
i could do korach, but i just stuck it in a try, and caught a null reference exeption, only to find that it no longer throws one.

thatnks for your help, but i think i'll leave it as it is, until it stops working again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top