我有一个Word文档导入到我的项目的资源文件中。将Resouce文件的Word文档显示到RichTextBox控件
是否可以提取此文档并将其显示在我的应用程序的RichTextBox控件中?
我能够使用下面的类从我的项目的资源文件中提取字符串和图像对象。
namespace TestProject
{
public class Utilities
{
private static ResourceManager _resource = new ResourceManager("TestProject.Resource1", Assembly.GetExecutingAssembly());
public static string GetString(string name)
{
return (System.String)(_resource.GetString(name));
}
public static Image GetImage(string name)
{
return (System.Drawing.Image) (_resource.GetObject(name));
}
}
}
是否将文档保存为RTF格式?如果是这样,您应该能够将资源值分配给RichTextBox.RTF属性。如果不是,我严重怀疑RichTextBox可以解析其他形式的Word文档。 – adelphus 2012-03-12 10:54:24