none
WPF操作Word的问题? RRS feed

答案

  • Hi 近水楼台,

    您可以参考下面的代码:
    http://www.svn8.com/dotnet/Csharp/2010012118485.html

    Regards,
    Aland Li

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    2010年5月12日 14:42
    版主

全部回复

  •   现想将一个Word/PPT文件导入到绘图板中,绘图板的底布是Canvas.请大家给点思路.谢谢!

    看你想如何处理word里面的内容了.word本身不公开格式信息,你只能用word提供的接口在做事情
    2010年5月11日 7:01
  • Hi 近水楼台,

    这个一般的做法是将word/ppt 文档另存为RTF格式,然后将RTF内容加载到RichTextBox里面去。下面的code演示了如何将RTF内容加载到RichTextBox:

        public void SetRTFText(string text)
        {
          MemoryStream stream = new MemoryStream(ASCIIEncoding.Default.GetBytes(text));
          this.richTextBox1.Selection.Load(stream, DataFormats.Rtf);
        }

    如果我的回复无帮助,请及时反馈。
    Aland Li


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    2010年5月11日 14:07
    版主
  • 我现在程序中获得了一个Word文档的路径,根据这个路径如何去读取Word中的这些文字呢?
    2010年5月12日 14:01
  • 我现在就是想把一个Word文件里的所有文字读取出来存放在一个string text变量中,如何读取一个指定的Word文档里的所有文字?然给段示例代码吗?
    2010年5月12日 14:05
  • Hi 近水楼台,

    您可以参考下面的代码:
    http://www.svn8.com/dotnet/Csharp/2010012118485.html

    Regards,
    Aland Li

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    2010年5月12日 14:42
    版主
  • Thanks!
    2010年5月13日 1:32