import header and footer

1 Answer 131 Views
WordsProcessing
alex
Top achievements
Rank 1
alex asked on 14 Jun 2023, 03:06 AM
 I want to create new file , is possible import header and footer from exist docx file ?

1 Answer, 1 is accepted

Sort by
0
Aleks
Telerik team
answered on 15 Jun 2023, 12:47 PM

Hi Alex,

Thank you for reaching out.

Importing a header and footer from an existing docx file is possible. They reside inside the Section element as part of the document model.
In order to do that you need first to import the docx containing the headers and footers you want, then remove the content of the sections which reside inside their Blocks collection, add whatever content you like, and finally export the docx.

To make things easier, I am attaching a sample project which does the abovementioned information. I hope this helps.

If you have any other questions, please do not hesitate to contact us.

Regards,
Aleks
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
WordsProcessing
Asked by
alex
Top achievements
Rank 1
Answers by
Aleks
Telerik team
Share this question
or