We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to set paragraph style after importing HTML into DOM using .NET

Hello,

according to this page https://docs.aspose.com/display/wordsnet/Style+Features+Supported+on+HTML+Import certain HTML elements are mapped to certain word styles. E.g. h1-elements are mapped to the “Heading 1” when using insertHTML. Is there a way of controlling this mapping? We would like to have the h1-element automatically use a different style than “Heading 1”. We are aware of using the class attribute to control the style used but we’d like to have a solution that maps all h1 elements in one go.

Kind regards

@bmpi

You can import HTML into Aspose.Words’ DOM and change style of Paragraph node. You can use ParagraphFormat.Style property to get or set the paragraph style applied to this formatting.

If you face any issue while using Aspose.Words, please ZIP and attach your simplified input and expected output documents. We will then provide you more information about your query.