Free Support Forum - aspose.com

Word integration - Extract Word document format

Hi,

I want to extract the formats used in a given word, to apply the same format in other documents.
Is there a way to extract the format in hierarchy?

Can I get the structure like in MS- Word command - DocumentMap from a given word document.

Regards,
Kathir

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your interest in Aspose.Words. In MS Word document formatting is applied on few levels. For example, let’s consider formatting of text. Text in documents is represented by Run element and Run is inside Paragraph. See document object model for more information:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/object-model-overview.html

You can apply Paragraph Style to Paragraph node and Glyph Style to Run node, moreover, you can apply direct formatting of text by Run attributes. Finally run will inherit formatting of Paragraph Style, Glyph Style and direct formatting.

You can get formatting and styles using node’s attributes.

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/aspose.words.style.html

However, in your case, I think, you should use template, where you define all necessary styles and use this template to build new documents.

Best regards.