1

We are developing C# .net 4.0 Windows Form Based Application. Here, User Will enter the Word Document paragraph 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.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Saravanan
  • 11,372
  • 43
  • 143
  • 213

1 Answers1

1
  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...

Saravanan
  • 11,372
  • 43
  • 143
  • 213