Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Nov 18, 2013 3:32 am

I got a trouble about saving .docx file from a richtextbox by writing a C# program with spire.Doc.

The follows are my codes for this program, after debugging, the window form will hang on.

Document doc = new Document();
//Add Section
//Section section = doc.AddSection();
//Add Paragraph
//Paragraph Para = section.AddParagraph();
//Append Text
//Para.AppendRTF(richTextBox1.Rtf);

SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.Filter = "Word *.docx|*.docx";
saveFileDialog1.Title = "Save an Word File";
saveFileDialog1.ShowDialog();
string filename=saveFileDialog1.FileName;
if(filename!="")
{

doc.SaveToFile(filename, FileFormat.Docx);
System.Diagnostics.Process.Start(filename);
}

Also, I try another method to write RTF content into a .docx file, but the .docx will show garbled text(for Chinese words):

Document doc = new Document();
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.Filter = "Word *.docx|*.docx";
saveFileDialog1.Title = "Save an Word File";
saveFileDialog1.ShowDialog();
string filename=saveFileDialog1.FileName;
if(filename!="")
{
richTextBox1.SaveFile(@"temp.rtf", RichTextBoxStreamType.RichText);
doc.LoadRtf(@"temp.rtf");
doc.SaveToFile(filename, FileFormat.Docx);
System.Diagnostics.Process.Start(filename);
}

Please help fix the problems above, thanks a lot !!

sangoshek
 
Posts: 2
Joined: Tue Nov 12, 2013 6:39 am

Mon Nov 18, 2013 8:16 am

Hello,

Thanks for your feedback.
Could you please provide us your richtextbox's content or the rtf document if convenience?

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Mon Nov 18, 2013 8:48 am

Please find the rtf document via the link below:

www9dropbox9com_s_dkziym2i5e7d58n_tempRTF.rtf

As the reply system does allow me to post URLs, please kindly change "9" to "." and "_" to "/" to complete the link above.

Thanks!

Gary.zhang wrote:Hello,

Thanks for your feedback.
Could you please provide us your richtextbox's content or the rtf document if convenience?

Thanks,
Gary
E-iceblue support team

sangoshek
 
Posts: 2
Joined: Tue Nov 12, 2013 6:39 am

Tue Nov 19, 2013 2:35 am

Hello,

Thanks for your information.
We have reproduced the issue, which has been transferred to our Dev team, once there are any progress from them, we will get it back to you immediately. Sorry for inconvenience.

If there are any questions, welcome to get it back to us.

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu Dec 05, 2013 8:11 am

Hello,

Sorry for long silence.
The issue has been resolved, and we have released the new version of Spire.Doc, please download and test Spire.Doc4.9.47 from http://www.e-iceblue.com/Download/downl ... t-now.html
​If there are any questions, welcome to get it back to us.
Sincerely,
Gary
E-iceblue support team​
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Return to Spire.Doc

cron