Skip to main content

Read text

Return the paragraph text, one paragraph per line, of the whole body, a range of paragraphs, the text inside a bookmark or one page, optionally with tables, headers and footers.

Command in the Word toolkit · id ooa.word/read_text · 8 inputs, 2 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
SessionStringNowordSession name.
Include tablesBooleanNofalseAlso return the text of table cells, in document order, one cell per line.
Include headers footersBooleanNofalseAlso return the text of page headers (before the body) and footers (after it).
From paragraphNumberNo1-based first body paragraph to read; the first when empty.
To paragraphNumberNo1-based last body paragraph to read; the last when empty.
BookmarkStringNoRead only the text between the start and end of this bookmark (tables inside it included); overrides the paragraph range and page.
PageNumberNoRead only this 1-based page (see page_breaks for how pages are counted); overrides the paragraph range.
Page breaksStringNoautoHow pages are counted: auto uses the page layout Word saved in the file when there is one, else the page and section breaks stored in it; layout uses only Word's saved layout; breaks uses only the stored breaks (pages Word fills up on its own are then not counted).

Outputs​

OutputTypeWhat it is
textStringDocument text.
paragraphsListEach body paragraph's text.