public void ExportToRtf(string filepath) { RtfFormatProvider provider = new RtfFormatProvider(); using (FileStream docStream = new FileStream(filepath, FileMode.OpenOrCreate)) { provider.Export(radRichTextBox1.Document, docStream); docStream.Dispose(); } }
public void loadrichtextbox() { DataTable dt = new DataTable(); string path = ""; dt = objorgBAl.GetOrgDocstatus(Globalclass.Activedatabase); if (dt.Rows.Count > 0) { if (dt.Rows[0]["DocCurrentStatus"].ToString() == "New" || dt.Rows[0]["DocCurrentStatus"].ToString() == "Approve" || dt.Rows[0]["DocCurrentStatus"].ToString()=="") { path = Globalclass.Activedatabase + objrootpath.DefaultOrgDocPath + "Missionandversion.rtf"; btnEditVision.Visible = true; pnlLock.Visible = false; } else { path = Globalclass.Activedatabase + objrootpath.DefaultOrgDocPath + "Missionandversion_Lck.rtf"; pnlLock.Visible = true; btnEditVision.Visible = false; } } else { path = Globalclass.Activedatabase + objrootpath.DefaultOrgDocPath + "Missionandversion.rtf"; btnEditVision.Visible = true; pnlLock.Visible = false; } if (File.Exists(path)) { using (System.IO.FileStream streamRTF = new System.IO.FileStream(path, System.IO.FileMode.Open)) { richTextBoxVision.LoadFile(streamRTF, RichTextBoxStreamType.RichText); streamRTF.Dispose(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)