# DOCX Working With Headersfooters

> Sub-skill of docx: Working with Headers/Footers.

- Skill: `vamseeachanta/docx-working-with-headersfooters` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vamseeachanta/docx-working-with-headersfooters`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vamseeachanta/docx-working-with-headersfooters/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: vamseeachanta (https://skillmd.com/u/vamseeachanta)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/vamseeachanta/docx-working-with-headersfooters

---


# Working with Headers/Footers

## Working with Headers/Footers


```python
from docx import Document

doc = Document()

# Add header
section = doc.sections[0]
header = section.header
header_para = header.paragraphs[0]
header_para.text = "Document Header"

# Add footer
footer = section.footer
footer_para = footer.paragraphs[0]
footer_para.text = "Page Footer"

doc.save("with_header_footer.docx")
```

