copy_table
Transplants one Word table from source to target document at a chosen location, carrying over styles, numbering, images, hyperlinks, footnotes, and bookmarks without modifying the source.
Instructions
Transplant ONE table from source_path into target_path: the single-element sibling of insert_document, reusing its resource reconciliation scoped to the table (styles matched BY NAME, target wins, unmatched cloned; fresh numbering; images/hyperlinks re-registered; footnote/endnote definitions under new ids; bookmarks remapped, collisions renamed).
table_index counts the SOURCE's top-level body tables (0-based, list_tables order; nested tables travel with their parent). Target position (exactly one): after_index is a body ITEM index counting paragraphs AND tables together (not the paragraph-only index other tools use); after_anchor matches a paragraph's FULL plain text, refusing with every location when it recurs; at_end appends. OLE/ActiveX/altChunks inside the table refuse the whole copy; nothing is half-applied. Returns row/column counts, the occupied body-item position, and per-resource counts. The source file is never modified. Auto-backup: prev/anchor slots in .ks4w-backups (backup=False skips rotation only); atomic validated save. Refuses documents open in Word.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at_end | No | ||
| backup | No | ||
| after_index | No | ||
| source_path | Yes | ||
| table_index | Yes | ||
| target_path | Yes | ||
| after_anchor | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||