我有一個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