This is a skill for creating and editing Word documents (.docx).
Main Features
- Document Creation: Headers, footers, paragraphs
- Style: Fonts, colors, formatting
- Table: Table creation
- Images: Image insertion
- Conversion: Markdown → DOCX
Python (python-docx)
from docx import Document
from docx.shared import Inches, Pt, RGBColor
doc = Document()
Title
title = doc.add_heading('Report Title', 0) title.alignment = WD_ALIGN_PARAGRAPH.CENTER
Paragraphsp = doc.add_paragraph('This is the body text.') p.add_run(' Bold text').bold = True p.add_run(' Italic text').italic = True
Tabletable = doc.add_table(rows=3, cols=3) table.style = 'Light Grid Accent 1'
hdr_cells = table.rows[0].cells hdr_cells[0].text = 'Name' hdr_cells[1].text = 'Age' hdr_cells[2].text = 'Occupation'
Imagesdoc.add_picture('image.png', width=Inches(4))
doc.save('report.docx')
## バージョン情報
- Version: 1.0.0