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

Free Support Forum - aspose.com

Can I add custom data to Paragraphs?

I want to pre-process a Word document, add some additional custom metadata to paragraphs and then pass the document onto another process.

Ideally I would want this to be an attribute of the paragraph, something like
<w:p tkbt:level=“3”>
or even


It doesn’t have to be valid WML since the next Process can be written to look for whatever we are outputting. Essentially need to be able to write out custom attributes on paragraph elements…Is there any way to do this via aspose?

Hi Simon,

Thanks for your inquiry. Could you please attach your input Word document and expected document here for our reference? We will investigate the structure of your expected document as to how you want your final output be generated like. You can create expected document using Microsoft Word. We will then provide you code to achieve the same using Aspose.Words.

Best regards,

No, you can’t do it using Word, it’s not valid WML, but I need to add it anyway. Is there no way to put a custom attribute into a paragraph element?

Hi Simon,

Thanks for your inquiry. I am afraid, you can only manipulate Paragraph’s content/attributes by using the properties/methods of Paragraph class mentioned in the following page:

Paragraph class

Best regards,