打开DocX文件(进入RTB/FlowDoc)或将其转换为RTF

问题描述:

  我需要将一个DOCX文件打开到RichTextBox上.我想知道我是否能够将docx文件转换为RTF文件,然后无法将RTF文件打开到窗口上的RT Box控件上.

   I need to open a DOCX file onto a RichTextBox. I was wondering if i am able to convert the docx file to RTF file then I will be able t open the RTF file onto my RT Box cntrol on my window.

或将docx文件转换为流文档以便可以将其加载到RTBox中的方法.

Or a way to convert the docx file to a flow document so it can be loaded into the RTBox.

请提出建议.

 

谢谢

Ram

嗨.... Ramanujam Sampath

Hi....Ramanujam Sampath

我不知道是否可以在RichTextBox中打开.docx文件.但是,您可以在中打开.docx文件. FlowDocumentPageViewer.

I don't know whether it is possible to open .docx file in RichTextBox or not. But You can open your .docx file in  FlowDocumentPageViewer.

例如.

Xaml代码

 <DockPanel>
  <FlowDocumentPageViewer x:Name="FlowDocViewer" Zoom="80" DockPanel.Dock="Top" FlowDirection="LeftToRight" />
</DockPanel>