开发者

How to get a reference to patricullar Word Document Paragraphs and then display it into Dsoframer or any Word Processing component for .net?

开发者 https://www.devze.com 2023-03-08 14:09 出处:网络
We are developing C# .net 4.0 Windows Form Based Application. Here, User Will enter the Word Document pa开发者_StackOverflow中文版ragraph number.After getting that Paragraph number, I want to Show tha

We are developing C# .net 4.0 Windows Form Based Application. Here, User Will enter the Word Document pa开发者_StackOverflow中文版ragraph number.After getting that Paragraph number, I want to Show that Selected Paragraph's in the any one of the WORD PROCESSING COMPONENT like Dsoframer or any other without changing the format. How i do it?

Using DSOFRAMER i could able to open the Entire Word Document.but I want to display only user selected paragraphs...

(OR)

I can able to retrieve the open xml representation of the user Selected Word document Pararaphs(USING OPEN XML SDK 2.0).Then how i paste it in to any WORD PROCESSING COMPONENT.


  Object fileName = "C:\\Documents and Settings\\saravanan\\Desktop\\test1.docx";
  axFramerControl1.Open(fileName, true, 0, "", "");

  Microsoft.Office.Interop.Word.Document wordDoc =     Microsoft.Office.Interop.Word.Document)axFramerControl1.ActiveDocument;
  Microsoft.Office.Interop.Word.Application wordApp = wordDoc.Application;

  Microsoft.Office.Interop.Word.Range r = wordDoc.Paragraphs[15].Range;
 //object dir = Microsoft.Office.Interop.Word.WdCollapseDirection.wdCollapseStart;
 //r.Collapse(ref dir);
 r.Select();

This Displays the 15th paragraph of your document with selection range...

0

精彩评论

暂无评论...
验证码 换一张
取 消