You can read tutorial https://www.roytuts.com/create-header-and-footer-in-word-document-using-python/