Displaying Word text as document Map

Hi,

I am trying to display only the document map of word document(msword2003),which we can see in msword.It display the data(mainly the heading h1,h2,h3) in a tree view format.
I want to find the headings and sub-headings.
The attachment give you the picture of the problem.

can any body give some idea how to read only headings(h1,h2,h3)in msword2003 fomat in asp.net2.0.

Hi,

Thank you for your request. To extract paragraphs whose style is HeadingN, use the following approach:

NodeCollection paragraphs = doc.GetChildNodes(NodeType.Paragraph, true);

foreach (Paragraph paragraph in paragraphs)

{

if ((paragraph.ParagraphFormat.Style.BuiltIn) && (paragraph.ParagraphFormat.Style.Name.StartsWith("Heading")))

{

// This paragraph is a heading paragraph...

}

}

Please let me know if it helps.

Hi DmitryV ,

Thanks.

It helped me alot.

--Srinivas

Hi,

I have another problem.

The Attched document give the tree view structure for a word document.

Now Iwant to goto a perticular node and display only it’s content including images and tables(as it is in word document).



Can you help me in this context.



Thanks in advance

Srinivas

I am afraid that is not possible as Aspose.Words does not perform rendering yet.

I mean Going to perticular node of the word documet and getting that paragraph content.



Is this not possible with aspose.

Try to check our souce code demo project called DocumentExplorer. It seems to solve the similar problem. Maybe you will find it insightful for your task too.