如何另存为Word文档 [英] How to Save as Word Document
本文介绍了如何另存为Word文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的应用程序中使用富文本框.我需要将其另存为Word文档.
我该怎么做.我已经添加了引用,但似乎只保存为Word文档,但无法在MS word中打开
所以,请大家帮忙!!!
谢谢
代码:
I''m using a rich-text box in my Application. i need to save it as a Word Document.
How do i Do it .i Have already Add the Reference but it seems like it only save as a word document, but could not open in MS word
So guys please Help !!!
Thank you
Code:
try
{
string SaveFile = "";
saveFileDialog1.Title = "Save File";
saveFileDialog1.FileName = "";
saveFileDialog1.Filter = "Word Document|*.docx";
if (saveFileDialog1.ShowDialog() != DialogResult.Cancel)
{
SaveFile = saveFileDialog1.FileName;
textArea.SaveFile(SaveFile, RichTextBoxStreamType.UnicodePlainText);
}
}
catch (Exception ex)
{
MessageBox.Show("I'm Sorry ! Something Went Wrong", "Error", MessageBoxButtons.RetryCancel, MessageBoxIcon.Stop);
}
推荐答案
使用SaveFile
或共享一些代码,这样我们就可以弄清您做错了什么.
http://msdn.microsoft.com/en-us/library/8bf5hy2e.aspx [ ^ ]
UseSaveFile
, or share some code so that we can get what you are doing wrong.
http://msdn.microsoft.com/en-us/library/8bf5hy2e.aspx[^]
尝试一下
http://www.csharp-station.com/Articles/WordReports.aspx [ ^ ]
try this
http://www.csharp-station.com/Articles/WordReports.aspx[^]
这篇关于如何另存为Word文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文