具有RichTextBox的C#应用​​程序 [英] C# Application With RichTextBox

查看:101
本文介绍了具有RichTextBox的C#应用​​程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如何将Word文档打开到richtextbox.Word文档包含文本和图像......

谁能为此提供解决方案...

谢谢
Vijay

Hi,

How to open the word document into richtextbox .The word document contians text and images ......

Can any one provide solution for this ...

Thanks
Vijay

推荐答案

RichTextBox不知道如何处理Word文档格式,因此您不要在RichTextBox中打开它.

现在,如果您的Word文档以RTF或文本格式保存,则可以使用,但根据文档中的内容,您将至少失去某些文档格式和一些编辑支持.
The RichTextBox doesn''t know how to handle the Word document format, so you don''t open it in a RichTextBox.

Now if your Word document was saved in RTF or Text format, that''ll work, but you''ll lose at least some document formatting and some editing support depending on what''s in the document.


您好,

尽管已经说过,富文本框控件只能加载RTF格式,而不能加载doc文件.但是,如果将Word文档另存为"Word 97-2003&6.0/95-RTF",则它将文件另存为带有doc扩展名的rtf文件.您可以使用以下语句打开该Word文档.

richTextBox1.LoadFile(@"C:\ Users \ VINOD \ Desktop \ CodeProject \ GridviewColumMErging.doc",
RichTextBoxStreamType.RichText);

谢谢!!!!
Hello,

Although this has already been said, Rich Text box Controls can only load RTF formats, not doc files. But if you save your word document as "Word 97-2003 & 6.0/95-RTF" it will save the file as an rtf file with a doc extension. You can open that word document using the following statement.

richTextBox1.LoadFile(@"C:\Users\VINOD\Desktop\CodeProject\GridviewColumMErging.doc",
RichTextBoxStreamType.RichText);

Thanks!!!


这篇关于CodeProject的文章可以为您提供帮助:
总结C#控制字技能 [
This article on CodeProject can help you:
Summarize C# Control Word Skills[^]


这篇关于具有RichTextBox的C#应用​​程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆